mirror of
https://github.com/glfw/glfw.git
synced 2026-09-19 15:25:50 +00:00
Introduced window positioning hints and window position properties
This commit is contained in:
@@ -238,6 +238,8 @@ GLFWAPI GLFWwindow glfwCreateWindow(int width, int height,
|
||||
wndconfig.refreshRate = Max(_glfwLibrary.hints.refreshRate, 0);
|
||||
wndconfig.resizable = _glfwLibrary.hints.resizable ? GL_TRUE : GL_FALSE;
|
||||
wndconfig.visible = _glfwLibrary.hints.visible ? GL_TRUE : GL_FALSE;
|
||||
wndconfig.positionX = _glfwLibrary.hints.positionX;
|
||||
wndconfig.positionY = _glfwLibrary.hints.positionY;
|
||||
wndconfig.clientAPI = _glfwLibrary.hints.clientAPI;
|
||||
wndconfig.glMajor = _glfwLibrary.hints.glMajor;
|
||||
wndconfig.glMinor = _glfwLibrary.hints.glMinor;
|
||||
@@ -369,6 +371,10 @@ void glfwDefaultWindowHints(void)
|
||||
_glfwLibrary.hints.resizable = GL_TRUE;
|
||||
_glfwLibrary.hints.visible = GL_TRUE;
|
||||
|
||||
// The default window position is the upper left corner of the screen
|
||||
_glfwLibrary.hints.positionX = 0;
|
||||
_glfwLibrary.hints.positionY = 0;
|
||||
|
||||
// The default is 24 bits of color, 24 bits of depth and 8 bits of stencil
|
||||
_glfwLibrary.hints.redBits = 8;
|
||||
_glfwLibrary.hints.greenBits = 8;
|
||||
@@ -437,6 +443,12 @@ GLFWAPI void glfwWindowHint(int target, int hint)
|
||||
case GLFW_VISIBLE:
|
||||
_glfwLibrary.hints.visible = hint;
|
||||
break;
|
||||
case GLFW_POSITION_X:
|
||||
_glfwLibrary.hints.positionX = hint;
|
||||
break;
|
||||
case GLFW_POSITION_Y:
|
||||
_glfwLibrary.hints.positionY = hint;
|
||||
break;
|
||||
case GLFW_FSAA_SAMPLES:
|
||||
_glfwLibrary.hints.samples = hint;
|
||||
break;
|
||||
@@ -747,6 +759,10 @@ GLFWAPI int glfwGetWindowParam(GLFWwindow handle, int param)
|
||||
return window->resizable;
|
||||
case GLFW_VISIBLE:
|
||||
return window->visible;
|
||||
case GLFW_POSITION_X:
|
||||
return window->positionX;
|
||||
case GLFW_POSITION_Y:
|
||||
return window->positionY;
|
||||
case GLFW_CLIENT_API:
|
||||
return window->clientAPI;
|
||||
case GLFW_OPENGL_VERSION_MAJOR:
|
||||
|
||||
Reference in New Issue
Block a user