mirror of
https://github.com/glfw/glfw.git
synced 2026-09-21 16:44:11 +00:00
Added window parameter to glfwSwapBuffers.
This commit is contained in:
+1
-3
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user