Problems with SwapBuffers()

Started by
8 comments, last by Finir 21 years, 11 months ago
Hi, i need a few new ideas or respective a few tips. In the last days i thought about the optimization of my 3D Render Engine and i have found the following problem. The SwapBuffers() is in my opinion to expensive. The current Testscene is very small (only a few cubes). The complete drawing is done in about 3 - 4 ms and the SwapBuffers() Function needs 11 - 14 ms. I have thought about these problem and i have trying to set the Flags PFD_SWAP_COPY or PFD_SWAP_EXCHANGE in the PixelFormatDescriptor ... yes i know these flags are only hints but anything i have done has changed nothing. Hmm, as a next step i have verified the hardware acceleration with my selected PixelFormat ... it´s activated! I have installed the newest Drivers for my Graphic Card but nothing helps ... If you have an idea, please help me :-) Here a few informations about my system: Win98, Geforce3 ... do you need more informations???
Advertisement
Let me see. 1000ms / (14+4)ms = 55fps

turn off VSYNC!

____________________________________________________________
www.elf-stone.com

____________________________________________________________www.elf-stone.com | Automated GL Extension Loading: GLee 5.00 for Win32 and Linux

SwapBuffers? then what''s glFlush for?
---Quite soon...ICQ: 163187735
They're completely unrelated.

swapbuffers is a GDI command to swap the back and front buffer.
glFlush is a GL command to clear the command buffers in the graphics card.

____________________________________________________________
www.elf-stone.com

[edited by - benjamin bunny on May 2, 2002 7:34:34 AM]

____________________________________________________________www.elf-stone.com | Automated GL Extension Loading: GLee 5.00 for Win32 and Linux

Hm, could you be more precise on when to use flushing?
---Quite soon...ICQ: 163187735
If you don''t know when to use glFlush => you don''t need it.

-Lev
glFlush

To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.
To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.
thanks, now the larger side of me knows where to look for gl reference
---Quite soon...ICQ: 163187735
Thank you benjamin bunny :-) (nice name)
i have turned off the VSYNC and it´s great, the first step is done :-) The time for SwapBuffers() is now by 6-8 ms. That´s a great boost for my Framerate ( ... or better for the framerate of my application :-) ). But now it should be possible to accelerate these function. 3-4 ms for drawing and 6-8 ms for SwapBuffers() ... that´s still to much. Has anyone another idea to accelerate these function??? At my opinion it should only be a exchange of 2 Pointers. Yes i know, it´s a little bit naive, but what´s happen in these invidious function?
Hi Maverick the divider,
you need SwapBuffers() if you use doublebuffers in your application. This means: you render in a not visible buffer and switch these buffers if you have completed the rendering. And now at these moment the Graphic Hardware will be render these buffer and you have another not visible buffer to render.
glFlush() has a complete other meaning. With glFlush() you force OpenGL to flushes the network and wait for notification from the graphics hardware that the drawing is complete.

This topic is closed to new replies.

Advertisement