Renamed context-related functions to more closely match underlying APIs.

This commit is contained in:
Camilla Berglund
2011-07-27 16:01:27 +02:00
parent 7268fc18b4
commit c1ab73b979
13 changed files with 103 additions and 102 deletions
+40 -2
View File
@@ -423,6 +423,44 @@ int _glfwStringInExtensionString(const char* string,
////// GLFW public API //////
//////////////////////////////////////////////////////////////////////////
//========================================================================
// Make the OpenGL context associated with the specified window current
//========================================================================
GLFWAPI void glfwMakeContextCurrent(GLFWwindow handle)
{
_GLFWwindow* window = (_GLFWwindow*) handle;
if (!_glfwInitialized)
{
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
return;
}
if (_glfwLibrary.currentWindow == window)
return;
_glfwPlatformMakeContextCurrent(window);
_glfwLibrary.currentWindow = window;
}
//========================================================================
// Returns the window whose OpenGL context is current
//========================================================================
GLFWAPI GLFWwindow glfwGetCurrentContext(void)
{
if (!_glfwInitialized)
{
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
return GL_FALSE;
}
return _glfwLibrary.currentWindow;
}
//========================================================================
// Swap buffers (double-buffering)
//========================================================================
@@ -560,7 +598,7 @@ GLFWAPI void* glfwGetProcAddress(const char* procname)
// Copies the specified OpenGL state categories from src to dst
//========================================================================
GLFWAPI void glfwCopyGLState(GLFWwindow hsrc, GLFWwindow hdst, unsigned long mask)
GLFWAPI void glfwCopyContext(GLFWwindow hsrc, GLFWwindow hdst, unsigned long mask)
{
_GLFWwindow* src;
_GLFWwindow* dst;
@@ -580,6 +618,6 @@ GLFWAPI void glfwCopyGLState(GLFWwindow hsrc, GLFWwindow hdst, unsigned long mas
return;
}
_glfwPlatformCopyGLState(src, dst, mask);
_glfwPlatformCopyContext(src, dst, mask);
}