mirror of
https://github.com/glfw/glfw.git
synced 2026-09-18 22:55:46 +00:00
Add glfwShowWindow, glfwHideWindow
Add glfwShowWindow and glfwHideWindow functions to allow explicit control over show/hide window. Remove platform specific show window code from _glfwPlatformCreateWindow but call glfwShowWindow from glfwCreateWindow to avoid breaking things (for now).
This commit is contained in:
@@ -318,6 +318,8 @@ GLFWAPI GLFWwindow glfwCreateWindow(int width, int height,
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
glfwShowWindow(window, 1); // TODO: consider if this is necessary!
|
||||
|
||||
// Cache the actual (as opposed to requested) window parameters
|
||||
_glfwPlatformRefreshWindowParams(window);
|
||||
|
||||
@@ -623,6 +625,38 @@ GLFWAPI void glfwIconifyWindow(GLFWwindow handle)
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Window show
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwShowWindow(GLFWwindow window)
|
||||
{
|
||||
if (!_glfwInitialized)
|
||||
{
|
||||
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
_glfwPlatformShowWindow((_GLFWwindow*)window);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Window hide
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwHideWindow(GLFWwindow window)
|
||||
{
|
||||
if (!_glfwInitialized)
|
||||
{
|
||||
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
_glfwPlatformHideWindow((_GLFWwindow*)window);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Window un-iconification
|
||||
//========================================================================
|
||||
|
||||
Reference in New Issue
Block a user