freeglut glutSwapBuffers error when closing window

Started by
0 comments, last by mattropo1is 15 years, 6 months ago
Sorry if this is just for OpenGL general questions, but I'm having a bit of trouble with freeGLUT's close function. My freeGLUT app works just fine, and if I close it by hand (press the Q key I have set up) everything finishes fine. But if I click on the window's X in the upper left, I get the message that: Error: Function <glutSwapBuffers> called with no current window defined. I know why it's happening (I continue to call the draw command because it hasn't hit my quit code that stops the rendering), but can't find the callback that gets triggered when someone clicks the window's close button as opposed to just using my keyboard method. I'm on windows if that helps. Anyone else run into this? Thanks in advance, M
Advertisement
Bah - I found it - simply handle the glutCloseFunc() callback function and you'll get called on any window event close notifications.

This topic is closed to new replies.

Advertisement