]> git.localhorst.tv Git - l2e.git/blobdiff - src/sdl/InitScreen.cpp
removed stupid file headers that eclipse put in
[l2e.git] / src / sdl / InitScreen.cpp
index 76030b1df0067aa610428cb93eff3ba7ca168848..e8f19b7c98d71bb927ea4dd627caf0b0482eea54 100644 (file)
@@ -1,10 +1,3 @@
-/*
- * InitScreen.cpp
- *
- *  Created on: Apr 22, 2012
- *      Author: holy
- */
-
 #include "InitScreen.h"
 
 #include <stdexcept>
@@ -27,6 +20,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 +29,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);
+       }
+}
+
 }