mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2024-12-22 09:30:32 +00:00
2fa9ffd1e3
Signed-off-by: Adrian Conlon <adrian.conlon@gmail.com>
21 lines
386 B
C++
21 lines
386 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <stdexcept>
|
|
|
|
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);
|
|
}
|
|
};
|
|
} |