Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

ChrisMan44

Double buffering

This topic is 5478 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
it''s in the piece of code that creates and sets the PixelFormat, notice the PFD_DOUBLE_BUFFER in the pfd initialization code.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!