PDA

View Full Version : glutFullScreen



Morglum
10-01-2001, 03:31 AM
Hi there,

I've got a problem : I use glutFullScreen to make my window full-screen. That works very well. But now I want that when one presses the 'Esc' key, my program exits. I use a glutKeyboardFunc callback. Here's my callback function :


void keyboard (unsigned char key, int x, int y)
{ if (key == 27) exit (0);
}


That works. But after that my system gets somewhat unstable. For example the 'sleep' function of the monitor makes it freeze. So I guess that I've not exited in the right way...

When I don't use glutFullScreen, I don't meet such problems.
In others applications using glutFullScreen, I've met the same problem.
When running my app on another machine, I've met the same problem.

What I would like is to know how to close a glutFullScreened window. Any idea would be greatly welcome !