I'm trying to port an OpenGL application from Windows to Linux.
I'm stuck at a call to glSwapInterval
which doesn't sound windows specific, but doesn't seem to exist on Linux. What include am I missing?
‘glSwapInterval’ was not declared in this scope
1.6k views Asked by user1273684 At
2
There are 2 answers
2
On
There is no such thing as glSwapInterval (...)
, because this is fundamentally a window system operation. OpenGL splits the task of managing windows and other platform-specific operation up into separate window APIs, which include WGL (Microsoft Windows), GLX (X11), EGL (OpenGL ES and some other systems) and CGL (OS X).
Because of this split between the core API and window system API, this function will be prefixed with something other than gl
, just as SwapBuffers
is. On Linux chances are you are using X11, so look for glXSwapIntervalEXT (...)
.
Check for the
GLX_EXT_swap_control
extension and useglXSwapIntervalEXT()
.Using something like
GLEW
(viaglxew.h
, see the "Platform Specific Extensions" section) makes the extension loading process easier.