How the hell do i detect that the user has closed a window using the close box in windows GLUT ?
The program just exits, without even calling the atexit callback, and i have some stuff to free !
Sorry, thereās no exit handling in GLUT. Mainly because glutMainLoop is not supposed to end I guess.
And any unfreed memory, or unclosed files are (or at least SHOULD) be freed/closed by the operating system.
Iāve used atexit() and it worked fine. Did you set it in your main before calling glutMainLoop() ?
main()
{
//ā¦
atexit(FreeMemory);
glutMainLoop();
}
Anyway this is NOT good !
Any c/c++ beginner would have added a āwindow closeā callback !
GLUT SUCKS and iām not gonna use it !
And thatās bad because the base idea of abstraction layer is great
Thanks for you help anyway.