mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2024-11-04 12:05:03 +00:00
89fae1cb6f
*) Add an SDLWrapper class to control the lifetime of SDL_Init/SDL_Quit *) Pass FPS as a float, rather than int *) Allow the key and button handlers to show whether an event was handled or not *) Add a full screen render option (F12) *) Use smart pointers in the GameController class Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
18 lines
346 B
C++
18 lines
346 B
C++
#pragma once
|
|
|
|
namespace Gaming {
|
|
class SDLWrapper final {
|
|
public:
|
|
SDLWrapper();
|
|
~SDLWrapper();
|
|
|
|
static void throwSDLException(std::string failure) {
|
|
throw std::runtime_error(failure + ::SDL_GetError());
|
|
}
|
|
|
|
static void verifySDLCall(int returned, std::string failure) {
|
|
if (returned < 0)
|
|
throwSDLException(failure);
|
|
}
|
|
};
|
|
} |