please help newbie
glutInitWindowPosition(0,0);
glutInitWindowSize(840,680);
glutCreateWindow("Title");
How do you use these properly? Do i need to incldue any files if so what ones?
Those are the window intialization functions from the glut library - glut aka "open gl toolkit" - you''ll need to #include glut.h and link you app with glut32.lib (on win32 machines). Start at opengl.org or use google to search out specific details - check the newsgroups too. Also start in opengl forums or opengl newgroups and proceed from there.
You have to download the glut files...$
And I''m used to use this funciton in my main_function, like this:
int main(int argc, char* argv[])
{
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_RGBA|GLUT_DOUBLE|GLUT_DEPTH);
glutInitWindowPosition(0,0);
glutInitWindowSize(1024,768);
glutCreateWindow("Le Monde");// Window Title
InitGL();
glutDisplayFunc(display);
glutReshapeFunc(reshape);
glutKeyboardFunc(keyboard);
glutIdleFunc(game_function);
glutMainLoop();
return 0;
}
But if you don''t want to open a window but enter in exclusive mode you should use the glutGameEnterGameMode function...performance are better...
And I''m used to use this funciton in my main_function, like this:
int main(int argc, char* argv[])
{
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_RGBA|GLUT_DOUBLE|GLUT_DEPTH);
glutInitWindowPosition(0,0);
glutInitWindowSize(1024,768);
glutCreateWindow("Le Monde");// Window Title
InitGL();
glutDisplayFunc(display);
glutReshapeFunc(reshape);
glutKeyboardFunc(keyboard);
glutIdleFunc(game_function);
glutMainLoop();
return 0;
}
But if you don''t want to open a window but enter in exclusive mode you should use the glutGameEnterGameMode function...performance are better...
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement