Yeah, I’m having a problem getting my program to do this correctly. I’m trying to write a ‘toggle full screen’ function for my program where it kills the window that was created using glutCreateWindow(“window title”); and displays my program in fullscreen using glutEnterGameMode(); Don’t know if this is even the correct way, but obviously, it’s not, because it kills my entire program when I run the code, and I get these command line errors as well:
GLUT: Warning in C:\DIR\OF\PROGRAM\PROGRAM.EXE: The following is a new check for GLUT 3.0; update your code.
GLUT: Fatal Error in C:\DIR\OF\PROGRAM\PROGRAM.EXE: redisplay needed for window 1, but no display callback.
Here’s what my code looks like:
if (glutGameModeGet(GLUT_GAME_MODE_POSSIBLE)) {
glutDestroyWindow(hWnd);;
glutEnterGameMode();
}
…where hWnd is the value returned by glutCreateWindow(“window title”); and I’m using GLUT 3.7.6.
What am I doing wrong here?
[This message has been edited by rpxmaster (edited 09-20-2002).]
Hi,
I have been using fullscreen mode with my OGL/GLUT programming for the past month. What is the glutGameMode and how is it different from regular fullscreen mode?
This message is the 2nd reference to this I have read today.
Are you talking about the difference between glutGameMode and glutFullscreen, or glutGameMode and ChangeScreenResolution functions, whatever they’re called?
Anyways, I did define my glutDisplayFunc sometime before I called glutDestroyWindow() function. Is there something else that I’m supposed to do, or what is it? I’m still having this problem.
I do not remember the exact syntax off the top of my head but there are a lot of good tutorials at Nehe’s web site. The tutorials are usually written for Windows but there are ports for Glut.
As far as I understand, the ports on NeHe’s web site toggle between glutCreateWindow and glutFullscreen. I do know there is code for glutGameMode, but I don’t believe it’ll let you go out of it, into glutCreateWindow. I need one that can go between glutCreateWindow and glutGameMode, if this is even possible.