Double buffering
I''ve written a few apps in opengl and am using the NeHe basedcode, I know the basecode asks for a double-buffered window. So where does this play into my program? I''ve never seen mentioned any functions dealing with a double buffer. I tried DirectX a bit and you explicitly switched buffers, but how would OpenGL know when to switch?
clear framebuffer
draw stuff
swapbuffers
double buffer is the viewed buffer and the frame buffer.
one you look at and one you draw to. swap buffers!
and they change types. Great for not drawing directly to the scene and getting ''torn'' images, unless vsync is off.
Bobby
draw stuff
swapbuffers
double buffer is the viewed buffer and the frame buffer.
one you look at and one you draw to. swap buffers!
and they change types. Great for not drawing directly to the scene and getting ''torn'' images, unless vsync is off.
Bobby
Game Core
In the nehe basecode, close to the end of the winmain function there is a call:
SwapBuffers(hDC);
This is the function that swtches the buffers .... look more carefully next time
SwapBuffers(hDC);
This is the function that swtches the buffers .... look more carefully next time

This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement