Example #1
0
void main(int argc, char **argv) {

	glutInit(&argc, argv);
	window.width = 1024;
	window.height = 1024;
	glutInitWindowSize(window.width, window.height);
	glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH);


	window.id = glutCreateWindow("LOL BRO");
	world = new World;

	glutDisplayFunc(MainLoop);
	//glutIdleFunc(MainLoop);
	glutMotionFunc(MouseActiveMotion);
	glutPassiveMotionFunc(MousePassiveMotion);


	//glfwEnable(GLFW_STICKY_KEYS);
	//glfwEnable(GLFW_STICKY_MOUSE_BUTTONS);
	editor.glui = GLUI_Master.create_glui_subwindow(window.id, GLUI_SUBWINDOW_RIGHT );
	


	GLUI_Master.set_glutIdleFunc(MainLoop);
	GLUI_Master.set_glutKeyboardFunc(Keyboard);
	GLUI_Master.set_glutSpecialFunc(SpecialKey);
	GLUI_Master.set_glutMouseFunc(MouseButton);
	GLUI_Master.set_glutReshapeFunc(Resize);
	 
	glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
	
	int seed = 0x18a8c1db;  // LOL BRO
	srand(seed);

	editor.CreateControls();
	renderer.Init();
	Init();
	jworld.Init();
	cloth.Init();

	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();


	glutMainLoop();
}