1 #include "InitScreen.h"
5 using std::runtime_error;
10 InitScreen::InitScreen(int width, int height, int bpp, Sint32 flags)
11 : screen(SDL_SetVideoMode(width, height, bpp, flags))
15 throw runtime_error("failed to open screen");
19 InitScreen::~InitScreen(void) {
24 SDL_Surface *InitScreen::Resize(int width, int height) {
25 SDL_Surface *newScreen(SDL_SetVideoMode(width, height, bpp, flags));
27 throw runtime_error("failed to resize screen");
29 return screen = newScreen;
32 void InitScreen::Flip(void) {
34 if (!(screen->flags & SDL_HWSURFACE)) {
35 // probably got no vsync, so suspend execution for a while