Example #1
0
void main(int argc, char* argv[]){
	/****************************************/
	/*   Initialize GLUT and create window  */
	/****************************************/

	glutInit(&argc, argv);

	//  Set the window x and y coordinates such that the 
	//  window becomes centered
	window.centerOnScreen();

	//  Connect to the windowing system + create a window
	//  with the specified dimensions and position
	//  + set the display mode + specify the window title.
	glutInitWindowSize(window.window_width, window.window_height);
	glutInitWindowPosition(window.window_x, window.window_y);

	glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE);
	main_window = glutCreateWindow("Bind Mesh");
	
	init();

	glutDisplayFunc(onDisplay);
	glutReshapeFunc(onReshape);
	glutKeyboardFunc(onKeyboard);
	glutMouseFunc(onMouse);
	glutMotionFunc(onMotion);
	glutEntryFunc(onEntry);

	scene = Scene(800, 600);
	scene.createModel("wasp.skel", "wasp.skin");
	//scene.createSkel("tube.skel");

	window = Window(800, 600, scene);
	window.main_window = main_window;

	//  Setup all GLUI stuff
	setupGLUI();

	glutMainLoop();
}
//*************************************************************************
//  Program Main method.
//*************************************************************************
int main (int argc, char **argv)
{
    //  Connect to the windowing system + create a window
    //  with the specified dimensions and position
    //  + set the display mode + specify the window title.
    glutInit(&argc, argv);
    glutInitWindowSize (window_width, window_height);
    glutInitWindowPosition (window_x, window_y);
    glutInitDisplayMode (GLUT_RGBA | GLUT_DOUBLE);
    main_window = glutCreateWindow (window_title);
    
    //  Set the window x and y coordinates such that the 
    //  window becomes centered
    centerOnScreen ();
    
    //  View in full screen if the full_screen flag is on
    if (full_screen)
        glutFullScreen ();

    //  Set OpenGL context initial state.
    init();
    
    // Set the GLUT callback functions
    glutDisplayFunc (display);
    glutReshapeFunc  (reshape);
    glutMouseFunc (mouse);
    glutMotionFunc (motion);
    glutPassiveMotionFunc (pmotion);
    glutKeyboardFunc (keyboard);
    glutSpecialFunc (special);
    glutEntryFunc (entry);

    //  Setup all GLUI stuff
    setupGLUI ();

    //  Start GLUT event processing loop
    glutMainLoop();
    return 0;
}