Skip to main content
GameDev.net gamedev.net
🔒 Locked

SDL_EnableKeyRepeat syncronization problem

Started by rossanaguerra Mar 31, 2012 at 8:35 AM 0 replies 1.2k views
Original Post
rossanaguerra
rossanaguerra
Hi everyone, this is my scenario. I have a background wich is scrolling, and I blit a spite over it.

If I press key by key and/or if have EnableKeyRepeat disabled: the sprite it is rendered ok, according the background moves.frame by frame.
This not a very playable scenario.
If I press continously with SDL_EnableKeyRepeat, the sprite flickers As if some key states weren't processed, so a 'blank' sprite appears.

The input handler is very straight forward: it sets the speed of background movement and it chooses the rectangle of the sprite sheet.

This is the code:

//Game Loop
/ /Event loop

apply_surface( bgX, bgY, background, screen );
apply_surface( bgX + background->w, bgY, background, screen );
// displaying sprite
car.show();


Any suggestion? thanks

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.