Re: Doubts about GPeriodic



On Thu, 2010-10-21 at 03:09 -0400, Havoc Pennington wrote:
> Another issue, seems like the ticker needs to be per-native-window:
> 
> * the GL context is per-window so the vsync mechanism also is

no, the GL context should *not* be per window. multiple GL contexts
usually pose more problems than they solve, in synchronization and
context switching, on basically all drivers - except maybe on nvidia[0].

this has nothing to do about whether GPeriodic should be per-window or a
global singleton - it's just that multiple contexts in a single process
are generally a no-no.

> Due to this and also the desire to not explode when the computer's
> clock is set, I would define the ticker to be a monotonic value that
> is in time units but is not a wall clock time. i.e. if I change my
> computer's clock back an hour, the ticker should keep marching
> forward, and the ticker is allowed to be fudged to make animations
> pretty.

the g_source_get_current_time() function will use the monotonic clock on
Linux assuming you link against gthread; since gobject does that, we can
safely assume that it will be using a monotonic clock.

ciao,
 Emmanuele.

[0] the first implementation of Clutter used multiple contexts, one for
each top-level, and shared the texture list to allow sharing resources
across top-levels; it did not have nice results - ironically, mostly on
fglrx, so I couldn't even look at a solution.

-- 
W: http://www.emmanuelebassi.name
B: http://blogs.gnome.org/ebassi



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