From 4923f1cf7e4d9f499fbd64a64012624444fe5bf8 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Wed, 21 May 2014 11:19:59 +0200 Subject: [PATCH] Call platform API directly where possible. --- src/window.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/window.c b/src/window.c index b7cc8fae..85d7e5ae 100644 --- a/src/window.c +++ b/src/window.c @@ -219,23 +219,23 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height, window->cursorMode = GLFW_CURSOR_NORMAL; // Save the currently current context so it can be restored later - previous = (_GLFWwindow*) glfwGetCurrentContext(); + previous = _glfwPlatformGetCurrentContext(); // Open the actual window and create its context if (!_glfwPlatformCreateWindow(window, &wndconfig, &ctxconfig, &fbconfig)) { glfwDestroyWindow((GLFWwindow*) window); - glfwMakeContextCurrent((GLFWwindow*) previous); + _glfwPlatformMakeContextCurrent(previous); return NULL; } - glfwMakeContextCurrent((GLFWwindow*) window); + _glfwPlatformMakeContextCurrent(window); // Retrieve the actual (as opposed to requested) context attributes if (!_glfwRefreshContextAttribs(&ctxconfig)) { glfwDestroyWindow((GLFWwindow*) window); - glfwMakeContextCurrent((GLFWwindow*) previous); + _glfwPlatformMakeContextCurrent(previous); return NULL; } @@ -243,7 +243,7 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height, if (!_glfwIsValidContext(&ctxconfig)) { glfwDestroyWindow((GLFWwindow*) window); - glfwMakeContextCurrent((GLFWwindow*) previous); + _glfwPlatformMakeContextCurrent(previous); return NULL; } @@ -253,10 +253,10 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height, _glfwPlatformSwapBuffers(window); // Restore the previously current context (or NULL) - glfwMakeContextCurrent((GLFWwindow*) previous); + _glfwPlatformMakeContextCurrent(previous); if (wndconfig.monitor == NULL && wndconfig.visible) - glfwShowWindow((GLFWwindow*) window); + _glfwPlatformShowWindow(window); return (GLFWwindow*) window; }