diff --git a/include/GameInternal.h b/include/GameInternal.h index beba641..4a49ca3 100644 --- a/include/GameInternal.h +++ b/include/GameInternal.h @@ -44,7 +44,7 @@ public: /* static */ AssetManager* assets; /* static */ TextureManager* textureManager; /* static */ SoundManager* soundManager; - /* static */ InputManager* inputs; + /* static */ InputManager* inputManager; Manager manager; RenderManager renderManager; diff --git a/src/GameInternal.cpp b/src/GameInternal.cpp index 33f4da6..50908a9 100644 --- a/src/GameInternal.cpp +++ b/src/GameInternal.cpp @@ -33,7 +33,7 @@ SDL_AppResult GameInternal::init(const char* title, int xpos, int ypos, int widt GameInternal::textureManager = new TextureManager(&manager); GameInternal::soundManager = new SoundManager(); GameInternal::collisionHandler = new CollisionHandler(manager); // why does this use a referrence, but AssetManager a pointer? - GameInternal::inputs = new InputManager(); + GameInternal::inputManager = new InputManager(); int flags = 0; if (fullscreen) @@ -123,6 +123,8 @@ void GameInternal::update(Uint64 frameTime) uint_fast16_t diffTime = frameTime - this->lastFrameTime; manager.update(diffTime); + inputManager->processEvents(); // TODO: find out if location is correct + this->gameInstance->update(diffTime); // TODO: this might have to be split up into two update functions, before and after manager... this->lastFrameTime = frameTime;