/* function main() * Description: * - this is the main function * - does initialization and then calls glutMainLoop() to start the event handler * - argv2 will eventually be for OpenCV */ int main(int argc, char **argv, char **argv2) { /* initialize the window and OpenGL properly */ glutInit(&argc,argv); glutInitWindowSize(WINDOW_WIDTH,WINDOW_HEIGHT); glutInitDisplayMode(GLUT_RGBA|GLUT_DOUBLE); glutCreateWindow("Misthaven"); /* set up our function callbacks */ bool ignoreRepeats = false; glutDisplayFunc(DisplayCallbackFunction); glutKeyboardFunc(KeyboardCallbackFunction); glutKeyboardUpFunc(KeyboardUpCallbackFunction); glutReshapeFunc(WindowReshapeCallbackFunction); glutTimerFunc(1,TimerCallbackFunction,0); /* initialize the image library engine */ initImageLibrary(); /* init the game */ theGame = new Game(); theGame->initializeGame(); /* start the event handler */ glutMainLoop(); return 0; }
/* function main() * Description: * - this is the main function * - does initialization and then calls glutMainLoop() to start the event handler */ int main(int argc, char **argv) { /* initialize the window and OpenGL properly */ glutInit(&argc,argv); glutInitWindowSize(WINDOW_WIDTH,WINDOW_HEIGHT); glutInitDisplayMode(GLUT_RGBA|GLUT_DOUBLE); glutCreateWindow("Jimmy's Cardboard Castle BETA BUILD"); /* set up our function callbacks */ glutDisplayFunc(DisplayCallbackFunction); glutKeyboardFunc(KeyboardCallbackFunction); glutKeyboardUpFunc(KeyboardUpCallbackFunction); glutSpecialFunc(SpecialCallbackFunction); glutSpecialUpFunc(SpecialUpCallbackFunction); glutReshapeFunc(WindowReshapeCallbackFunction); glutMouseFunc(MouseClickCallbackFunction); glutMotionFunc(MouseMotionCallbackFunction); glutPassiveMotionFunc(MouseMotionCallbackFunction); glutTimerFunc(1,TimerCallbackFunction,0); /* initialize the image library engine */ initImageLibrary(); /* init the game */ theGame = new Game(); theGame->setNewWorld(new MainMenu()); theGame->setNewWorld(new TestWorld()); theGame->setNewWindowSize(WINDOW_WIDTH,WINDOW_HEIGHT); theGame->setScreenSize(WINDOW_SCREEN_WIDTH, WINDOW_SCREEN_HEIGHT); theGame->initializeGame(); /* start the event handler */ glutMainLoop(); return 0; }