Solution Overview:
I needed a way to close the GLFW window from any part of my application. Initially, I tried calling glfwSetWindowShouldClose(window, GLFW_TRUE)
, but I wasn't sure how to get the correct window
pointer into the other screen modules.
What I tried & why it fell short:
What changed:
static
and public
. This allowed global access without passing it around.Result:
Now, I can simply call App::window
from any screen and close the window cleanly, improving both readability and maintainability.