]> git.localhorst.tv Git - blank.git/commitdiff
handle events in headless environment
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Wed, 7 Oct 2015 15:36:16 +0000 (17:36 +0200)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Wed, 7 Oct 2015 15:36:16 +0000 (17:36 +0200)
src/app/app.cpp
src/app/init.cpp

index 98c7286a7970916c70a7b107b90b5e0b301f08de..2d5aa4fd05b6eb5df3653878d0bd7af6551a1317 100644 (file)
@@ -98,6 +98,8 @@ void HeadlessApplication::Run() {
 
 void HeadlessApplication::Loop(int dt) {
        env.counter.EnterFrame();
+       HandleEvents();
+       if (!HasState()) return;
        Update(dt);
        CommitStates();
        if (!HasState()) return;
index 81c2e9291cec57c61d039e223922c73d52adf8fd..f4bcd01f45a230c4a1d928f967f60c0ff494ba19 100644 (file)
@@ -77,8 +77,8 @@ SDLError::SDLError(const std::string &msg)
 
 
 InitSDL::InitSDL() {
-       if (SDL_Init(0) != 0) {
-               throw SDLError("SDL_Init(0)");
+       if (SDL_Init(SDL_INIT_EVENTS) != 0) {
+               throw SDLError("SDL_Init(SDL_INIT_EVENTS)");
        }
 }