SDL: why the texts in my game jumpy?

Started by
4 comments, last by 0x3a 12 years, 8 months ago
[size="5"]hi,
when i refresh the screen while waited for the user input, the text that i draw with tff fonts were jumpy. how do i fix that?
any help will be appreciated.
thanks

Advertisement
First, keep the default text size, making it bigger will not make us want to help you more.

Second, describe it better, how is it jumpy ? Screenshot or possibly a video would make us understand better.
Snippets of your implementation maybe.
If I've helped you in any way please push the reputation button, thanks!

Abstraction is my choice of words.
Portfolio: http://www.0x3a.com/
Blog: http://blog.0x3a.com/
hi,

i am sorry about the large text size. the text in my screen is very small. i enlarged it so i can see it better. sorry about that.

i wrote my first game program in SDL by implementing a first AI program when i was in college. the program is about a 8's puzzle if that is what they called. it is a 3x3 square where the computer moves the tiles around to get to a goal state. it is a first AI program in AI class when i was in college 20 years ago. beside displaying the puzzle, i also display some texts to instruct the player what keys to press to change tile or to find solution.

the puzzle displayed was stable, but the text that i display was flickering. i tried to use SDL_Delay, but it slow down the input i get from the user.

i hope i included all the info for you to help me if not, ask me more questions.

i also attached the source file that i used.

thanks for your reply.
The flickering could be caused by not double buffering. Do you draw it directly on the screen or on a separate surface which is than copied onto the viewable screen ?
If I've helped you in any way please push the reputation button, thanks!

Abstraction is my choice of words.
Portfolio: http://www.0x3a.com/
Blog: http://blog.0x3a.com/
hi,
i draw it the the surface before i update it. now i will use double buffer.
thanks
Did this fix your issue ?
If I've helped you in any way please push the reputation button, thanks!

Abstraction is my choice of words.
Portfolio: http://www.0x3a.com/
Blog: http://blog.0x3a.com/

This topic is closed to new replies.

Advertisement