I'm building a game using SDL in Linux platform.
Now I want to read user input with SDL_GetKeyboardState
, but my doubt is wich is the best way using a thread or a timer.
I tried both and I think they work well.
|
If you have uncapped FPS, it should eat 100% of your CPU, but most probably you want cap FPS at some reasonable value, say 60 fps, basic implementation can be as follows:
|
|||||||||||||||||
|