I'm really starting out with LWJGL (I just started) and I focused on one thing: When I create a window and I want to set it as not resizable, I use:
glfwWindowHint(GLFW_RESIZABLE, GL_FALSE);
window = glfwCreateWindow(WIDTH, HEIGHT, TITLE, NULL, NULL);
However, even if I want to set this after the window was created, I do not know how. I just tried to put the command after the creation of the window, but it won't work:
window = glfwCreateWindow(WIDTH, HEIGHT, TITLE, NULL, NULL);
glfwWindowHint(GLFW_RESIZABLE, GL_FALSE);
So, how I can resolve this?
From the GLFW Window Guide:
Window creation hints
There are a number of hints that can be set before the creation of a window and context. Some affect the window itself, others affect the framebuffer or context. These hints are set to their default values each time the library is initialized with glfwInit, can be set individually with glfwWindowHint and reset all at once to their defaults with glfwDefaultWindowHints.
Note that hints need to be set before the creation of the window and context you wish to have the specified attributes.
Essentially, you set hints like whether the window should be resizable, which context version it has etc. through glfwWindowHint()
calls. These hints will then be used the next time you create a window with glfwCreateWindow()
. If you set hints after the window has been created, then only new windows created after the call will be affected.
Therefore, it is currently not possible to change certain GLFW window properties, like whether it is resizable, after creation.