Fixed the SDL and Mouselook Problem

This is an old article from 2011. I was a kid. I learned a lot since then, so please do think twice when taking advice from me as a kid.

After spending hours trying to figure out why my mouselook function didn’t work with SDL, I finally got a solution.

The problem was that I didn’t use SDL_PumpEvents() before calling SDL_GetMouseState(). But if I do that I get the next problem: my Keyboard Events get delayed because the event-queue got enormous.

In the end I decided to put the mouse motion handling in where I handled the SDL-events. That worked. I’ll post some code very soon, so if somebody has a similar problem, he/she doesn’t need to spend hours on it, as I did.

Greetings, Squareys

This post was imported from tumblr.