X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fsdl%2FInitScreen.cpp;h=13fb6b620bfef50d4a27bef256626659eefe3f7d;hb=3a86cc937e9fce68384efc08edb6d6ba101d12eb;hp=76030b1df0067aa610428cb93eff3ba7ca168848;hpb=e2a44553d5c38295e447af45868b7e576d3a433d;p=l2e.git diff --git a/src/sdl/InitScreen.cpp b/src/sdl/InitScreen.cpp index 76030b1..13fb6b6 100644 --- a/src/sdl/InitScreen.cpp +++ b/src/sdl/InitScreen.cpp @@ -27,6 +27,7 @@ InitScreen::~InitScreen(void) { } + SDL_Surface *InitScreen::Resize(int width, int height) { SDL_Surface *newScreen(SDL_SetVideoMode(width, height, bpp, flags)); if (!newScreen) { @@ -35,4 +36,12 @@ SDL_Surface *InitScreen::Resize(int width, int height) { return screen = newScreen; } +void InitScreen::Flip(void) { + SDL_Flip(screen); + if (!(screen->flags & SDL_HWSURFACE)) { + // probably got no vsync, so suspend execution for a while + SDL_Delay(1); + } +} + }