SDL++
C++wrapperfortheSDLlibrary.
|
00001 00021 #ifndef SDL_SDL_H 00022 #define SDL_SDL_H 00023 00024 #include <stdexcept> 00025 00026 #include <SDL.h> 00027 00028 namespace sdl { 00029 using namespace std; 00030 00034 class Sdl { 00035 public: 00041 static Sdl& instance () { 00042 static Sdl instance_; 00043 return instance_; 00044 }; 00045 00051 SDL_version compileVersion () { 00052 SDL_version version; 00053 SDL_VERSION (&version); 00054 return version; 00055 }; 00056 00062 const SDL_version* linkedVersion () { return SDL_Linked_Version (); }; 00063 00064 private: 00070 Sdl () { 00071 if (SDL_Init (0) == -1) 00072 throw std::runtime_error (SDL_GetError ()); 00073 }; 00074 00080 Sdl (const Sdl& rhs); 00081 00085 ~Sdl () { SDL_Quit (); }; 00086 00094 Sdl& operator= (const Sdl& rhs); 00095 }; //Sdl 00096 }; //sdl 00097 00098 #endif //SDL_SDL_H 00099