MGL_glSwapBuffers

Swaps the display buffers for OpenGL rendering.

Declaration

void MGLAPI MGL_glSwapBuffers(
MGLDC *dc,
int waitVRT)

Prototype In

mgraph.h

Parameters

dc | MGL device context to swap display buffers for
waitVRT | True to wait for vertical retrace

Description

This function swaps the OpenGL rendering buffers, and the current back buffer becomes the front buffer and vice versa. If you are running in a window, the context of the back buffer will be copied to the current window. If you are running in a fullscreen graphics mode with hardware page flipping, this function will do a hardware page flip to swap the buffers.

When the OpenGL buffers are swapped, you should normally allow MGL/OpenGL driver to sync to the vertical retrace to ensure that the change occurs in the correct place, and that you don't get flicker effects on the display. You may however turn off the vertical retrace synching if you are synching up with the retrace period using some other means, or if you are measuring the performance of your application.

Copyright © 2002 SciTech Software, Inc. Visit our web site at http://www.scitechsoft.com