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

Re: [pygame] flip() and opengl





On 9/4/06, Cameron Blackwood <korg@xxxxxxxxxxxxx> wrote:

David writes:
|
|
| What does the flip() function do exactly, in OpenGL mode?

flip() toggles the buffer but on _some_ OS's it also _waits_ until the
screen is being displayed.

On windows, the _max_ fps I can get is 75 because thats
what my monitor operates at and opengl's flip() waits until the
monitor is displaying the buffer i just flipped to.
 
I have seen fps rates over 80 on one of my WinXP machines; maybe I am using a higher refresh rate, and I am not at that machine to test at the moment. 
 
My profiler runs tell me that the flip() operation takes as much as 35 ms (that is 1/30 of a second just for one flip call).
When I use display lists in lieu of scripted drawing sequences, the fps rate goes up, but the duration of the flip does as well.
For my experimentation script ('forest.py' in the SPyRE demo directory), the scripted way displays a 7-8 fps, with flip taking under 5 ms, and the display list way acheives 14-15 fps with 35 ms flips.   These numbers are all really dismal, suggesting I am doing something wrong in my OpenGL management.
 
The graphics generation in 'forest' is almost all done usiing quadrics.  There are a few simple polygons as well.
 
Thank you, Cameron, for the assistance, but I think I am seeing a different limitation than you describe.
 
David
 
 

 
On unix, the same code can get 200+ because it doesnt wait for
the montior to display (but my monitor still works at only 75 fps,
so those extra updates dont get me anything). (Except maybe glitches
if I flip mid frame.)

Check out page 22 of the red book, "The Refresh that Pauses".
 
I will try and remember to check that tonight after work.




--
dkeeney@xxxxxxxxxxxxxxxx
Pitcher's Duel -> pitchersduel.python-hosting.com