فهرست منبع

Fixed window parameter refresh.

Camilla Berglund 13 سال پیش
والد
کامیت
1736132bb2
5فایلهای تغییر یافته به همراه10 افزوده شده و 12 حذف شده
  1. 1 1
      src/cocoa_window.m
  2. 1 1
      src/internal.h
  3. 1 2
      src/win32_window.c
  4. 6 5
      src/window.c
  5. 1 3
      src/x11_window.c

+ 1 - 1
src/cocoa_window.m

@@ -1041,7 +1041,7 @@ void _glfwPlatformRestoreWindow(_GLFWwindow* window)
 // Write back window parameters into GLFW window structure
 //========================================================================
 
-void _glfwPlatformRefreshWindowParams(void)
+void _glfwPlatformRefreshWindowParams(_GLFWwindow* window)
 {
 }
 

+ 1 - 1
src/internal.h

@@ -326,7 +326,7 @@ void _glfwPlatformWaitEvents(void);
 void _glfwPlatformMakeContextCurrent(_GLFWwindow* window);
 void _glfwPlatformSwapBuffers(void);
 void _glfwPlatformSwapInterval(int interval);
-void _glfwPlatformRefreshWindowParams(void);
+void _glfwPlatformRefreshWindowParams(_GLFWwindow* window);
 int  _glfwPlatformExtensionSupported(const char* extension);
 GLFWglproc _glfwPlatformGetProcAddress(const char* procname);
 void _glfwPlatformCopyContext(_GLFWwindow* src, _GLFWwindow* dst, unsigned long mask);

+ 1 - 2
src/win32_window.c

@@ -1198,10 +1198,9 @@ void _glfwPlatformRestoreWindow(_GLFWwindow* window)
 // Write back window parameters into GLFW window structure
 //========================================================================
 
-void _glfwPlatformRefreshWindowParams(void)
+void _glfwPlatformRefreshWindowParams(_GLFWwindow* window)
 {
     DEVMODE dm;
-    _GLFWwindow* window = _glfwLibrary.currentWindow;
 
     ZeroMemory(&dm, sizeof(DEVMODE));
     dm.dmSize = sizeof(DEVMODE);

+ 6 - 5
src/window.c

@@ -318,17 +318,18 @@ GLFWAPI GLFWwindow glfwOpenWindow(int width, int height,
         return GL_FALSE;
     }
 
-    // Cache the actual (as opposed to desired) window parameters
-    _glfwPlatformRefreshWindowParams();
+    // Cache the actual (as opposed to requested) window parameters
+    _glfwPlatformRefreshWindowParams(window);
 
+    // Cache the actual (as opposed to requested) context parameters
     glfwMakeContextCurrent(window);
-
     if (!_glfwRefreshContextParams())
     {
         glfwCloseWindow(window);
         return GL_FALSE;
     }
 
+    // Verify the context against the requested parameters
     if (!_glfwIsValidContext(&wndconfig))
     {
         glfwCloseWindow(window);
@@ -573,7 +574,7 @@ GLFWAPI void glfwSetWindowSize(GLFWwindow handle, int width, int height)
     {
         // Refresh window parameters (may have changed due to changed video
         // modes)
-        _glfwPlatformRefreshWindowParams();
+        _glfwPlatformRefreshWindowParams(window);
     }
 }
 
@@ -665,7 +666,7 @@ GLFWAPI void glfwRestoreWindow(GLFWwindow handle)
     _glfwPlatformRestoreWindow(window);
 
     if (window->mode == GLFW_FULLSCREEN)
-        _glfwPlatformRefreshWindowParams();
+        _glfwPlatformRefreshWindowParams(window);
 }
 
 

+ 1 - 3
src/x11_window.c

@@ -1137,10 +1137,8 @@ void _glfwPlatformRestoreWindow(_GLFWwindow* window)
 // Read back framebuffer parameters from the context
 //========================================================================
 
-void _glfwPlatformRefreshWindowParams(void)
+void _glfwPlatformRefreshWindowParams(_GLFWwindow* window)
 {
-    _GLFWwindow* window = _glfwLibrary.currentWindow;
-
     // Retrieve refresh rate if possible
     if (_glfwLibrary.X11.RandR.available)
     {