From 86d82a0b535e88d841a927f3574cc9bd228f55fe Mon Sep 17 00:00:00 2001 From: Daniel Karbach Date: Wed, 7 Oct 2015 17:36:16 +0200 Subject: [PATCH] handle events in headless environment --- src/app/app.cpp | 2 ++ src/app/init.cpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) 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)"); } } -- 2.39.2