GLFW and window minimize callback function

anonymous wrote on Tuesday, May 22, 2012:

I like the way you can set callback functions to handle all the window and io
specific events when they occur. But there’s one callback missing: a callback
when window gets minimized. That would be very useful, because you could then
set the program in sleep mode so it wouldn’t take all the CPU power. I don’t
feel like checking if the window is minimized in a loop, since it takes some
cpu power to make that function call. I would appreciate if that callback
could be added to GLFW 3.0, or if you could actually set custom callbacks
based on some parameters you pass to callback registration function.

elmindreda wrote on Tuesday, May 22, 2012:

glfwWaitEvents will return after events have been processed, including events
not passed on via callbacks. You therefore only need to check the window’s
iconification status after it returns and can avoid an active loop.

GLFW 3 already has a callback for iconification events, but it’s more a matter
of convenience.