SFML community forums

Help => Graphics => Topic started by: kol on October 18, 2013, 09:24:41 pm

Title: small breaks
Post by: kol on October 18, 2013, 09:24:41 pm
When I'm running my game, he's taking small breaks. What can it be? Not heavy, has nothing in the loop just draws a sprite.

Sorry, my bad english.
Title: AW: small breaks
Post by: eXpl0it3r on October 18, 2013, 09:59:53 pm
Can you provide a minimal and complete example that reproduces the issue?

In which way do you experience those "breaks"? Is it during movement or just fps drops?
Title: Re: small breaks
Post by: kol on October 18, 2013, 10:54:27 pm
In the drawing, if I put a variable (int) and show the screen with the sf :: text, gives waged from time to time.
Title: Re: small breaks
Post by: Ixrec on October 18, 2013, 10:59:10 pm
I have no idea what "waged" means.

I think you're going to have to post (complete and minimal) code and screenshots of the problem for us to have any idea what you're talking about.
Title: Re: small breaks
Post by: kol on October 19, 2013, 05:31:26 pm
http://www.youtube.com/watch?v=k3_2ZcLux_8&feature=youtu.be

Look at the video, the movement is never constant, always gives small lag
Title: Re: small breaks
Post by: Ancurio on October 21, 2013, 10:39:45 pm
Try turning on VSync:

Code: [Select]
window.setVerticalSyncEnabled(true);
Title: Re: small breaks
Post by: Gobbles on October 22, 2013, 01:21:53 am
You kind of blaze by your main loop so I couldn't tell if you used a fixed timestep or not. In case your not, try this: http://gafferongames.com/game-physics/fix-your-timestep/
Title: Re: small breaks
Post by: binary1248 on October 22, 2013, 02:28:53 am
I managed to get a look at the loop.

https://github.com/SFML/SFML/wiki/FAQ#wiki-graphics-smooth-animation
Title: Re: small breaks
Post by: kol on October 24, 2013, 02:32:30 pm
Thanks to all, solved ! :)