From: Daniel Karbach Date: Wed, 7 Oct 2015 15:36:16 +0000 (+0200) Subject: handle events in headless environment X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=86d82a0b535e88d841a927f3574cc9bd228f55fe;p=blank.git handle events in headless environment --- diff --git a/src/app/app.cpp b/src/app/app.cpp index 98c7286..2d5aa4f 100644 --- a/src/app/app.cpp +++ b/src/app/app.cpp @@ -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; diff --git a/src/app/init.cpp b/src/app/init.cpp index 81c2e92..f4bcd01 100644 --- a/src/app/init.cpp +++ b/src/app/init.cpp @@ -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)"); } }