Jump to content
  • Advertisement
Sign in to follow this  
ICUP

[SDL] Flushing Queue

This topic is 3494 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
There is a moment in my game where when the player character dies, he is respawned in the center of the screen by gradually appearing (through SDL_SetAlpha). During this time, if the player hits the arrow keys, when the loop that makes him appear is over and the new round of the game begins the character moves because the keyboard press events that were in queue become active.

Is there any other way around this?

Share this post


Link to post
Share on other sites
I don't know how your code is organized, but I would personally check the event queue within the fade in loop and discard input events you don't care about then and there while responding to events that should logically interrupt the process -- like the SDL_QUIT event that rip-off mentioned.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!