glutswapbuffers(3) - Linux man page

Name

glutSwapBuffers - Swaps the buffers for the current window.

Library

OpenGLUT - window

Synopsis

#include <openglut.h>

void

glutSwapBuffers(void);

Description

This function signals to OpenGLUT that you are done drawing to the current window for now. If your window is double-buffered ( GLUT_DOUBLE param to glutInitDisplayMode()), then OpenGLUT will swap the front buffer with the back buffer.

This also computes your current frame-rate and prints the result on stderr if indicated by the GLUT_FPS environment variable. The computed value is not necessarily the total frame rate, if you have multiple windows, as the statistic is the total number of buffer-swaps for the entire program.

Caveats

This function has no effect if your window is GLUT_SINGLE .

Frame rate is only calculated for double-buffered windows.

Todo

How does this interact with overlays?

Consider making GLUT_FPS keep per-window stats in a multi-window program.

See Also

glutpostredisplay(3) glutpostoverlayredisplay(3) glutpostwindowredisplay(3) glutpostwindowoverlayredisplay(3) glutinitdisplaymode(3)

BSD Epoch BSD

Referenced By

glutinit(3)