Fixed window parameter refresh.

master
Camilla Berglund ago%!(EXTRA string=13 years)
parent 3c912cbc3c
commit 1736132bb2
  1. 2
      src/cocoa_window.m
  2. 2
      src/internal.h
  3. 3
      src/win32_window.c
  4. 11
      src/window.c
  5. 4
      src/x11_window.c

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

@ -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);

@ -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);

@ -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);
}

@ -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)
{

Loading…
Cancel
Save