In glfw is there any way on setting the window position before or while the window being is created? I know there is glfwSetWindowPos()
but I can only call this after the window is created and I get a flash change in position, I'm looking for something similar to glut's glutInitWindowPosition()
function which is called just before the window is created, so that the window is instantiated at the given position without having to move anywhere.
Create a hidden window (GLFW_VISIBLE
), change the position (glfwSetWindowPos
) and show the window (glfwShowWindow
). For instance:
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
GLFWwindow *window = glfwCreateWindow(640, 480, "my window", NULL, NULL);
glfwSetWindowPos(window, 100, 100);
glfwShowWindow(window);