mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2024-09-01 15:29:11 +00:00
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);
|
|
}
|
|
};
|
|
} |