Sign in to follow this  
nickme

SDL: why the texts in my game jumpy?

Recommended Posts

nickme    253
[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

[/size]

Share this post


Link to post
Share on other sites
0x3a    109
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.

Share this post


Link to post
Share on other sites
nickme    253
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.

Share this post


Link to post
Share on other sites
0x3a    109
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 ?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this