Re: turning off display...



I have a game app I'm working on.

I'm using somebody else's board widget.  It's built using a ton of gdk
calls.

I want to be able to back up in a sequence of moves.  The easiest way of
doing this is to clear the board and repaint from the beginning.

When I do this, the user can see a sequence of moves being replayed.
It's not the most pleasing thing to look at.

Is there any simple way I can temporarily turn off display of changes,
kind of like the refresh() call in curses, so that people won't see my
changed board until the changes are complete?

Please respond directly to me and I'll summarize.

Sorry, I didn't reply to your previous message.

I suppose you need to use a double-buffer mechanism,
so you can quietly build your image on the background
and then just swap the back and front buffer images.

This is a standard procedure with OpenGL graphic
routines, and you can also do it easily on a
standard drawing area, just using pixmaps
(there's a full example in Eric Harlow's
book, showing how to draw a analog watch
using a double-buffer with gtk1.2). 

For the other usual gtk widgets (buttons, 
boxes, tables, windows, etc...), gtk2.0 
is double-buffered automatically
so these problems don't exist, I believe.
gtk1.2 does not have a double-buffer though.
If you need a double-buffer of the gtk widgets
(note that this is totally different than the
drawing area, that I discussed above), I suppose 
you will be much better of with gtk2.0.

Carlos



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]