Moved OpenGL-related functions into *opengl files.

This commit is contained in:
Camilla Berglund
2011-03-04 14:25:12 +01:00
parent 74a6c872d6
commit aae8999ecf
12 changed files with 128 additions and 128 deletions
+1 -1
View File
@@ -11,10 +11,10 @@ set(libglfw_SOURCES ${common_SOURCES}
x11_enable.c
x11_fullscreen.c
x11_gamma.c
x11_glext.c
x11_init.c
x11_joystick.c
x11_keysym2unicode.c
x11_opengl.c
x11_time.c
x11_window.c)
@@ -56,6 +56,36 @@ void (*glXGetProcAddressEXT(const GLubyte* procName))();
////// GLFW internal API //////
//////////////////////////////////////////////////////////////////////////
//========================================================================
// Swap OpenGL buffers
//========================================================================
void _glfwPlatformSwapBuffers(void)
{
glXSwapBuffers(_glfwLibrary.X11.display,
_glfwLibrary.currentWindow->X11.handle);
}
//========================================================================
// Set double buffering swap interval
//========================================================================
void _glfwPlatformSwapInterval(int interval)
{
_GLFWwindow* window = _glfwLibrary.currentWindow;
if (window->GLX.has_GLX_EXT_swap_control)
{
window->GLX.SwapIntervalEXT(_glfwLibrary.X11.display,
window->X11.handle,
interval);
}
else if (window->GLX.has_GLX_SGI_swap_control)
window->GLX.SwapIntervalSGI(interval);
}
//========================================================================
// Check if an OpenGL extension is available at runtime
//========================================================================
-30
View File
@@ -1566,36 +1566,6 @@ void _glfwPlatformRestoreWindow(_GLFWwindow* window)
}
//========================================================================
// Swap OpenGL buffers
//========================================================================
void _glfwPlatformSwapBuffers(void)
{
glXSwapBuffers(_glfwLibrary.X11.display,
_glfwLibrary.currentWindow->X11.handle);
}
//========================================================================
// Set double buffering swap interval
//========================================================================
void _glfwPlatformSwapInterval(int interval)
{
_GLFWwindow* window = _glfwLibrary.currentWindow;
if (window->GLX.has_GLX_EXT_swap_control)
{
window->GLX.SwapIntervalEXT(_glfwLibrary.X11.display,
window->X11.handle,
interval);
}
else if (window->GLX.has_GLX_SGI_swap_control)
window->GLX.SwapIntervalSGI(interval);
}
//========================================================================
// Read back framebuffer parameters from the context
//========================================================================