int main(int argc, char** argv) {
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH);
glutGameModeString("width=1024;height=768;bpp=32;");
if (glutGameModeGet(GLUT_GAME_MODE_POSSIBLE)) {
glutEnterGameMode();
printf("%d", glutGameModeGet(GLUT_GAME_MODE_PIXEL_DEPTH));
} else {
exit(1);
}
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
glShadeModel(GL_SMOOTH);
glEnable(GL_DEPTH_TEST);
glEnable(GL_TEXTURE_2D);
glutReshapeFunc(resize);
glutDisplayFunc(display);
glutIdleFunc(idle);
atexit(atexit);
Keyboard.Init();
Mouse.Init();
Map.Init("data\\maps\\floor.map", "data\\maps\\walls.map", "data\\maps\\ceiling.map", "data\\textures\\floor.png", "data\\textures\\wall.png", "data\\textures\\ceiling.png");
// Camera.SetCamera(11.0f, 1.5f, 6.0f, 16.0f, 1.5f, 16.0f, 0.0f, 1.0f, 0.0f);
Camera.SetCamera(0.0f, 1.5f, 0.0f, 6.0f, 1.5f, 6.0f, 0.0f, 1.0f, 0.0f);
glutMainLoop();
return 0;
}
glutGameMode Problem
Hi there. I'm trying to make an OpenGL game but I ran into a problem. Whenever I start the application, the color depth is always 8 bit (it doesn't matter what I request with glutGameModeString) and I cannot get over 5 FPS - it feels like it's software rendering or ever worse. I have no idea why this happens and I could really use some help. Thank a lot.
This is my main() function:
Quote:Original post by FireDKThe mode string uses spaces or tabs as separators, not semi-colons, so the string should be "width=1024 height=768 bpp=32". Alternatively, you can use the compact representation, in which case the mode string would be "1024x768:32".glutGameModeString("width=1024;height=768;bpp=32;");
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement