EightBit/Gaming/inc/SDLWrapper.h
Adrian Conlon 2fa9ffd1e3 Tidy up some C++ a little
Signed-off-by: Adrian Conlon <adrian.conlon@gmail.com>
2021-04-07 21:36:09 +01:00

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);
}
};
}