glutGameMode Problem

Started by
1 comment, last by FireDK 15 years, 5 months ago
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:

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;
}
Born from The Dark, in The Black Cloak of Night!
Advertisement
Quote:Original post by FireDK
glutGameModeString("width=1024;height=768;bpp=32;");
The 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".

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

Quote:Original post by swiftcoder
Quote:Original post by FireDK
glutGameModeString("width=1024;height=768;bpp=32;");
The mode string uses spaces or tabs as separators, not semi-colons, so the string should be "width=1024 height=768 bpp=32".


This works. Thank you very much.
Born from The Dark, in The Black Cloak of Night!

This topic is closed to new replies.

Advertisement