X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fsdl%2FInitScreen.cpp;h=76030b1df0067aa610428cb93eff3ba7ca168848;hb=4a1816af30dcfe53181a25355bd51cc7b24a83f1;hp=c9b275fc83ad5d758322743799363151cd343e38;hpb=a378f581fb88ce4ca718a18d7cc80d7007ebc66a;p=l2e.git diff --git a/src/sdl/InitScreen.cpp b/src/sdl/InitScreen.cpp index c9b275f..76030b1 100644 --- a/src/sdl/InitScreen.cpp +++ b/src/sdl/InitScreen.cpp @@ -15,7 +15,9 @@ using std::runtime_error; namespace sdl { InitScreen::InitScreen(int width, int height, int bpp, Sint32 flags) -: screen(SDL_SetVideoMode(width, height, bpp, flags)) { +: screen(SDL_SetVideoMode(width, height, bpp, flags)) +, bpp(bpp) +, flags(flags) { if (!screen) { throw runtime_error("failed to open screen"); } @@ -25,4 +27,12 @@ InitScreen::~InitScreen(void) { } +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; +} + }