mirror of
https://github.com/glfw/glfw.git
synced 2026-09-21 00:30:57 +00:00
Removed glfwSetWindowPos and glfwGetWindowPos
glfwGetWindowPos is superseded by glfwGetWindowParam() with GLFW_POSITION_X and GLFW_POSITION_Y as parameters. glfwSetWindowPos can easily lead to bad practices (moving windows around without the users consent), and has been replaced with the GLFW_POSITION_X/Y window hints that allow setting the window position for a newly created window.
This commit is contained in:
@@ -598,52 +598,6 @@ GLFWAPI void glfwSetWindowSize(GLFWwindow handle, int width, int height)
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Get the window position
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwGetWindowPos(GLFWwindow handle, int* xpos, int* ypos)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
|
||||
if (!_glfwInitialized)
|
||||
{
|
||||
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
if (xpos != NULL)
|
||||
*xpos = window->positionX;
|
||||
|
||||
if (ypos != NULL)
|
||||
*ypos = window->positionY;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set the window position
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwSetWindowPos(GLFWwindow handle, int xpos, int ypos)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
|
||||
if (!_glfwInitialized)
|
||||
{
|
||||
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
if (window->mode == GLFW_FULLSCREEN || window->iconified)
|
||||
{
|
||||
// TODO: Figure out if this is an error
|
||||
return;
|
||||
}
|
||||
|
||||
_glfwPlatformSetWindowPos(window, xpos, ypos);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Window iconification
|
||||
//========================================================================
|
||||
|
||||
Reference in New Issue
Block a user