Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


SDL_EnableKeyRepeat syncronization problem


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
No replies to this topic

#1 kovicic   Members   -  Reputation: 100

Like
0Likes
Like

Posted 31 March 2012 - 02:35 AM

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

Sponsor:



Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS