}
+
SDL_Surface *InitScreen::Resize(int width, int height) {
SDL_Surface *newScreen(SDL_SetVideoMode(width, height, bpp, flags));
if (!newScreen) {
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);
+ }
+}
+
}
SDL_Surface *Screen(void) { return screen; };
const SDL_Surface *Screen(void) const { return screen; };
- void Flip(void) { SDL_Flip(screen); };
+ void Flip(void);
SDL_Surface *Resize(int width, int height);
private: