X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fsdl%2FInitScreen.cpp;fp=src%2Fsdl%2FInitScreen.cpp;h=0000000000000000000000000000000000000000;hb=61c2d30a60d586cbe63885885c6a373c7713af1e;hp=2ed13dde339c953ac813105167fb7b0203751ef1;hpb=08d0e47634e1632c96ebe3308535a86f5e625b40;p=space.git diff --git a/src/sdl/InitScreen.cpp b/src/sdl/InitScreen.cpp deleted file mode 100644 index 2ed13dd..0000000 --- a/src/sdl/InitScreen.cpp +++ /dev/null @@ -1,40 +0,0 @@ -#include "InitScreen.h" - -#include - -using std::runtime_error; - - -namespace space { - -InitScreen::InitScreen(int width, int height, int bpp, Sint32 flags) -: screen(SDL_SetVideoMode(width, height, bpp, flags)) -, bpp(bpp) -, flags(flags) { - if (!screen) { - throw runtime_error("failed to open screen"); - } -} - -InitScreen::~InitScreen() { - -} - - -SDL_Surface *InitScreen::Resize(int width, int height) { - SDL_Surface *newScreen(SDL_SetVideoMode(width, height, bpp, flags)); - if (!newScreen) { - throw runtime_error("failed to resize screen"); - } - return screen = newScreen; -} - -void InitScreen::Flip() { - SDL_Flip(screen); - if (!(screen->flags & SDL_HWSURFACE)) { - // probably got no vsync, so suspend execution for a while - SDL_Delay(1); - } -} - -}