Search code examples
c++glfw

Modifying window size with GLFW


When I use GLFW to create a window with glfwWindowHint(GLFW_DECORATED, GLFW_FALSE); to remove window decorations, how can I resize the window by dragging with the mouse?

"I tried using glfwSetCursorEnterCallback(window, cursor_enter_callback) but it doesn't seem to work.


Solution

  • When you are setting up GLFW add the following hint:

    glfwWindowHint(GLFW_RESIZABLE, GLFW_TRUE);
    

    If you want to resize the window programmatically you can still use:

    glfwSetWindowSize(window, width, height);