LWJGL 3 - render after window restore

Started by nbilyk, March 23, 2015, 01:48:18

Previous topic - Next topic

nbilyk

If I'm making something with non-continuous rendering, how do I check if the display is dirty from something like minimizing and restoring?

There used to be org.lwjgl.opengl.Display.isDirty, but I don't know what the equivalent is in 3.

SHC

In GLFW you can set a Window Iconify callback, which is called when your window is iconified (minimized) and restored. You then will know when it will be dirty, or when it's not.

// The Callback function
private void glfwIconifyCallback(long window, int iconify)
{
    if (iconify == 0)
        // Handle restore event
    else
        // Handle minimized event
}

// Set the callback to the window
GLFWWindowIconifyCallback callback = GLFWWindowIconifyCallback(this::glfwIconifyCallback);
glfwSetWindowIconifyCallback(myWindow, callback);

That is how you specify the window iconify callback in GLFW. Don't forget to release this callback before destroying the window. Hope this helps.

nbilyk