Re: Keeping program flow moving nicely

Eric M. Monsler wrote:

"Timothy M. Shead" wrote:


Use gtk_timeout_add() to create a 'timeout' signal that gets called,
say, every 100 milliseconds or so.  In your handler for the timeout
event you decide whose turn it is and call process_move().

What is the gtk behavior in this situation, if it takes more than 100 ms
to do process_move()?  I have no idea if this game does so, but I'm
curious what would happen.

I don't recall what GTK+'s behaviour is in this situation. My project is a 3D graphics app where screen refreshes can easily exceed the timeout, so it's a good issue to bring up ... I forgot to mention that I only use every other timeout signal for drawing - leaving a "catchup" timeout between screen refreshes guarantees that GTK+ will have a chance to process other events.

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