C
Chris Forone
hello group,
im working on an app and have two (ok more) questions:
1) i want to sync my pgm-logic to its "natural" periode: the vertical
retrace of the monitor. i do this with a function named eglSwapBuffers
(http://www.khronos.org/registry/egl/sdk/docs/man/xhtml)
this func blocks until the vsync occurs: "Subsequent client API commands
may be issued on that context immediately after calling eglSwapBuffers,
but are not executed until the buffer exchange is completed." (quote) i
think its some sort of polling-func?!
now i have the idea, to put some kind of logic to the new c++11 threads.
in pseudo-code:
getTimeStamp start (from steady-clock)
doAllLogic to listOfObjects
drawAllObjects (should be fast because of opengl/gpu)
getTimeStamp now
if timeStamp now - start < refreshRateTime
sleep
eglSwapBuffers
is this a good approach or are there big problems because of
thread-resolution and this things?
can i have an influence to some thread-params to optimize thread-behavior?
sorry for my bad english.
second question will follow soon...
thanks for your time, cheers, chris
im working on an app and have two (ok more) questions:
1) i want to sync my pgm-logic to its "natural" periode: the vertical
retrace of the monitor. i do this with a function named eglSwapBuffers
(http://www.khronos.org/registry/egl/sdk/docs/man/xhtml)
this func blocks until the vsync occurs: "Subsequent client API commands
may be issued on that context immediately after calling eglSwapBuffers,
but are not executed until the buffer exchange is completed." (quote) i
think its some sort of polling-func?!
now i have the idea, to put some kind of logic to the new c++11 threads.
in pseudo-code:
getTimeStamp start (from steady-clock)
doAllLogic to listOfObjects
drawAllObjects (should be fast because of opengl/gpu)
getTimeStamp now
if timeStamp now - start < refreshRateTime
sleep
eglSwapBuffers
is this a good approach or are there big problems because of
thread-resolution and this things?
can i have an influence to some thread-params to optimize thread-behavior?
sorry for my bad english.
second question will follow soon...
thanks for your time, cheers, chris