Hi Emmanuele, I already experimented with the repaint function. but the timestamps I get have some variance. So the only way I see to get a more or less accurate timing is to use an average time value over some hundred frames.
By the way, I am just playing around with some FBO and shader routines. Since you don't suggest to mix Cogl with direct calls to GL, but I would like to have the possibility to have an FBO with multiple color targets I would like to know if you have any plans to extend the cogl offscreen API to use glDrawBuffers? E.g. sth like cogl_offscreen_add_texture(CoglHandle buffer, CoglHandle texture, guint layer); to be able to use glFragData[] in a fragment shader instead of glFragColor? bye, Roland On 05.04.2010, at 15:11, Emmanuele Bassi wrote: On Sun, 2010-04-04 at 09:50 +0200, Roland Peffer wrote: > Is there an elegant way to get the exact screen frequency ( in microseconds > or even more accurate ) within the clutter/cogl toolkit? no. in part because there is nothing elegant, in part because the vblank synch is part of how Clutter works. if we have the right extension, on GLX we default to getting an asynchronous notification of a buffer swap; lacking that, we check if glXSwapBuffers() will block and use that delay to time our animations and scene redraws. lacking that, we fall back to a hard timer which may or may not be the same rate of the vblank. if you want to tap into the redraw rate you can install a "repaint function" using clutter_threads_add_repaint_func(); the function is guaranteed to be called each time Clutter redraws the Stages. ciao, Emmanuele. -- Emmanuele Bassi, Open Source Software Engineer Intel Open Source Technology Center -- To unsubscribe send a mail to [email protected]
