PDA

View Full Version : glutEnterGameMode



Eclipix
05-07-2002, 07:41 PM
so i just tried this entergame mode out, but my image does not show up, i just get a blank black screen. Is there something im forgetting to declare or call?

Bob
05-07-2002, 09:52 PM
And how are we supposed to know what you forgot to do, if you don't tell us WHAT you do? There can be a few houndred things that can cause the image not to appear on the screen. That includes silly things like not calling glutMainLoop, drawing it outside the screen, drawing the image in a completely black color on a black background, or not drawing the image at all. If you don't provide us with any details, we can't even guess what's wrong.

Eclipix
05-07-2002, 10:03 PM
sorry, my bad, my program runs fine with glutcreatwindow(). I simply replace creatwindow with enter gamemode, Here:

int main(int argc, char **argv)
{
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize(800,800);
//glutCreateWindow("Ball");
glutEnterGameMode();
glutDisplayFunc(display);
glutKeyboardFunc(keyboard);
glutSpecialFunc(arrows);
init();
glEnable(GL_DEPTH_TEST);
glutMainLoop();
return 0;
}

I have my lookat setup in my display, it works fine when the creatwindow is enableed, i dont believe that is the problem.

Morglum
05-07-2002, 10:37 PM
You forgot calling glutGameModeString. Example :
glutInit (&argc, argv);
glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
glutGameModeString("1024x768:32");
if (glutGameModeGet (GLUT_GAME_MODE_POSSIBLE)) {
glutEnterGameMode();
}

Eclipix
05-08-2002, 06:11 AM
Hey thanx, that did the trick. I appreciate it tons.