Exemplo n.º 1
0
/*******************************************************************************
Main function: calls initialization, then hands over control to the event
handler, which calls display() whenever the screen needs to be redrawn.
*******************************************************************************/
int main(int argc, char** argv) 
{
	initODE();						//Initialize the dynamics world.
	
	glutInit(&argc, argv);
	glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
	glutInitWindowPosition (0, 0);
	glutInitWindowSize(g_width,g_height);
	glutCreateWindow(argv[0]);

	myinit();

	glutIdleFunc(idleCB) ;
	glutReshapeFunc (myReshape);
	glutKeyboardFunc( myKey );
	glutMouseFunc(myMouseCB);
	glutMotionFunc(myMotionCB);
	GDrawing::plotInstructions();

	glutDisplayFunc(display);
	glutMainLoop();

	g_timer.Reset();
	return 0;         //Never reached
}
Exemplo n.º 2
0
int main(int argc, char ** argv)
{
  SDL_Surface *screen;

  if(readParams(argc,argv))
    {
      return 0;
    }

  if(SDL_Init(SDL_INIT_EVERYTHING) < 0)
    {
      printf("Error: SDL_Init(SDL_INIT_EVERYTHING) < 0\n");
      return -1;
    }

  screen=SDL_SetVideoMode(800,600,32,SDL_SWSURFACE|SDL_OPENGL);
  if(screen == 0)
    {
      printf("error: SDL_SetVideoMode() == 0\n");
      return -1;
    }

  mousey=mousex=0;

  initODE();

  initGL();

  mainLoop();

  closeODE();

  SDL_Quit();

  return 0;
}