SDL_PollEvent |
chris
|
I can find another topic about this problem so any kind of comment would be nice
no suggestions, tipps or even stupid jokes about my bad spelling? |
|||||||||||
|
UbuntuTheOS
|
I'm looking at your code and I'm slightly curious. I don't want to judge your code since I as well am fairly new to the SDL library, but are you using the SDL_GetError() function at all in this program to determine where problems may arise? In every tutorial I have seen, there was a way to incorporate that function in there and if you ran into any errors, the function told you what was wrong. I'd help you out with your SDL_PollEvent loop problem, but sadly I'm not that experienced. I will get back to you when I find out what's wrong with it, though. |
|||||||||||||
|
mr_tawan
|
Well I think this is not really an SDL problem. If you change to ,say, DirectX, you would find the same exact problem :-). SDL_GetError() won't complain anything.
From your code, you process everything insides event-polling loop, even if it's nothing about event/input. SDL_PollEvent() pull event from the event queue, it returns false when there is no event left in the queue. Since there is no event in the event queue (as there's no input), the loop is just get skipped altogether. You might want to try moving the logic that does not involved with the inputs/events out of the poll loop, place it outside just below that loop (inside the render loop). You should see some animation even if there's no input. I think you might want to pick up a good game programming book for beginner. I couldn't come up with any title right now btw (sorry about that). |
|||||||||||
|