Reputation: 115
I need to use glSwapBuffers in my code, but to my surprise, this method is not in the header GL/gl.h . Which header file do I need to include to be able to use this method? Not using it is not an option since I am providing an interface for other clients and this is part of the documented interface.
Upvotes: 6
Views: 12643
Reputation: 162164
There is no function "glSwapBuffers", OpenGL doesn't define it. Swapping the front and back buffer of a double buffered window is a function provided by the underlying graphics system, i.e. Win32 GDI, or X11 GLX. The function's you're looking for are wglSwapBuffers
and/or glXSwapBuffers
. On MacOS X NSOpenGLViews are automatically swapped.
However most likely you're using some framework, like GLUT, GLFW or Qt, which provide a portable wrapper around those functions. Read the framework's documentation.
Upvotes: 21