PDA

View Full Version : SwapBuffers



spidey
08-08-2001, 08:08 AM
Do I want to Swap buffers when I handle the WM_PAINT msg or at the end of my WinMain?

V--man
08-08-2001, 10:25 AM
After you do your opengl rendering, inside WM_PAINT seems like the logical place to me.

V-man

Akash
08-08-2001, 04:14 PM
U can swap buffers in wm_paint (optional) but u have to swap buffers after ur done with ur scene. Because WM_PAINT wouldn't get called as often as ur rendering function.

08-08-2001, 05:55 PM
You can call SwapBuffers anytime you want. If you are doing some sort of animation, then after you render each frame you can go ahead and call it, regardless of the WM_PAINT message. If you only need to update the scene when your window is changed then WM_PAINT will let you know, and you can go ahead and call SwapBuffers.

richardve
08-08-2001, 07:24 PM
For editing programs (ie. shader editor, world editor, etc) I'm using WM_PAINT for handling the rendering because it doesn't use 100% of the CPU time that way.

For games/techdemos/demos I'm NOT using WM_PAINT because it should be as FAST as possible..
(and letting WM_PAINT handling your rendering is definitely NOT fast enough)

spidey
08-09-2001, 10:51 AM
Yeah, is should have worded my question a little better. It was the whole WM_PAINT msg not getting handled every frame. So I should probably be swapping buffers right at the end of my rendering code. But know I make sure I handle every single msg in the queue each frame.