Initial commit. Not even a game yet :P
[cToan.git] / src / SDLWrap_Display.cpp
blobf55bcb855695a336d256384eefdb9d4c9fa0b3a5
1 #include "SDLWrap_Display.hpp"
3 namespace SDLWrap {
5 Display::Display(int Width, int Height, int BPP, Uint32 Flags)
6 try {
7 if ( (this->me = SDL_SetVideoMode(Width, Height, BPP, Flags)) == NULL)
8 throw SurfaceCreationError();
10 catch(SurfaceCreationError)
12 ErrorHandler::OutputError(ErrorHandler::FATAL_CONSTRUCTOR_ERROR, "Display::Display(int, int, int, Uint32) constructor threw a SurfaceCreationError!\n");
15 Display::~Display()
17 SDL_FreeSurface(this->me);
20 bool
21 Display::Flip()
23 return (SDL_Flip(this->me) == 0);