Added window parameter to glfwSwapBuffers.

This commit is contained in:
Camilla Berglund
2012-08-06 18:13:37 +02:00
parent aff30d0baa
commit 585a840329
29 changed files with 37 additions and 44 deletions
+1 -3
View File
@@ -51,10 +51,8 @@ void _glfwPlatformMakeContextCurrent(_GLFWwindow* window)
// Swap buffers
//========================================================================
void _glfwPlatformSwapBuffers(void)
void _glfwPlatformSwapBuffers(_GLFWwindow* window)
{
_GLFWwindow* window = _glfwLibrary.currentWindow;
// ARP appears to be unnecessary, but this is future-proof
[window->NSGL.context flushBuffer];
}
+1 -1
View File
@@ -324,7 +324,7 @@ void _glfwPlatformWaitEvents(void);
// OpenGL context management
void _glfwPlatformMakeContextCurrent(_GLFWwindow* window);
void _glfwPlatformSwapBuffers(void);
void _glfwPlatformSwapBuffers(_GLFWwindow* window);
void _glfwPlatformSwapInterval(int interval);
void _glfwPlatformRefreshWindowParams(_GLFWwindow* window);
int _glfwPlatformExtensionSupported(const char* extension);
+4 -8
View File
@@ -541,21 +541,17 @@ GLFWAPI GLFWwindow glfwGetCurrentContext(void)
// Swap buffers (double-buffering)
//========================================================================
GLFWAPI void glfwSwapBuffers(void)
GLFWAPI void glfwSwapBuffers(GLFWwindow handle)
{
_GLFWwindow* window = (_GLFWwindow*) handle;
if (!_glfwInitialized)
{
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
return;
}
if (!_glfwLibrary.currentWindow)
{
_glfwSetError(GLFW_NO_CURRENT_CONTEXT, NULL);
return;
}
_glfwPlatformSwapBuffers();
_glfwPlatformSwapBuffers(window);
}
+1 -3
View File
@@ -545,10 +545,8 @@ void _glfwPlatformMakeContextCurrent(_GLFWwindow* window)
// Swap buffers (double-buffering)
//========================================================================
void _glfwPlatformSwapBuffers(void)
void _glfwPlatformSwapBuffers(_GLFWwindow* window)
{
_GLFWwindow* window = _glfwLibrary.currentWindow;
SwapBuffers(window->WGL.DC);
}
+1 -1
View File
@@ -344,7 +344,7 @@ GLFWAPI GLFWwindow glfwCreateWindow(int width, int height,
// Clearing the front buffer to black to avoid garbage pixels left over
// from previous uses of our bit of VRAM
glClear(GL_COLOR_BUFFER_BIT);
_glfwPlatformSwapBuffers();
_glfwPlatformSwapBuffers(window);
return window;
}
+2 -3
View File
@@ -642,10 +642,9 @@ void _glfwPlatformMakeContextCurrent(_GLFWwindow* window)
// Swap OpenGL buffers
//========================================================================
void _glfwPlatformSwapBuffers(void)
void _glfwPlatformSwapBuffers(_GLFWwindow* window)
{
glXSwapBuffers(_glfwLibrary.X11.display,
_glfwLibrary.currentWindow->X11.handle);
glXSwapBuffers(_glfwLibrary.X11.display, window->X11.handle);
}