X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fapp%2FApplication.cpp;h=e06e231d785535488554f9b09975410f8942f667;hb=4a1816af30dcfe53181a25355bd51cc7b24a83f1;hp=37f3135c48d8f4d3c92d1b323481f343d913157f;hpb=a378f581fb88ce4ca718a18d7cc80d7007ebc66a;p=l2e.git diff --git a/src/app/Application.cpp b/src/app/Application.cpp index 37f3135..e06e231 100644 --- a/src/app/Application.cpp +++ b/src/app/Application.cpp @@ -13,7 +13,7 @@ namespace app { -Application::Application(SDL_Surface *screen, State *initialState) +Application::Application(sdl::InitScreen *screen, State *initialState) : screen(screen) , states() , last(SDL_GetTicks()) { @@ -42,7 +42,7 @@ void Application::PushState(State *s) { void Application::RealPushState(State *s) { states.push(s); - s->EnterState(*this, screen); + s->EnterState(*this, screen->Screen()); } void Application::PopState(void) { @@ -94,6 +94,10 @@ void Application::HandleEvents(void) { case SDL_QUIT: PopAllStates(); break; + case SDL_VIDEORESIZE: + screen->Resize(event.resize.w, event.resize.h); + CurrentState()->Resize(event.resize.w, event.resize.h); + break; default: CurrentState()->HandleEvent(event); break; @@ -110,8 +114,8 @@ void Application::UpdateWorld(Uint32 deltaT) { void Application::Render(void) { if (!CurrentState()) return; - CurrentState()->Render(screen); - SDL_Flip(screen); + CurrentState()->Render(screen->Screen()); + screen->Flip(); } }