Ejemplo n.º 1
0
void mainLoop(int i){
	switch(i){
		case 1:
		t.transport();	// jedna tura gry
		t.draw();	// wyswietla obecny stan gry
		break;
		case 2: t.draw(); break;
	}
	if(count++ < max)
		glutTimerFunc(timeout, mainLoop, 1);
	else
		glutTimerFunc(timeout, mainLoop, 2);
}
Ejemplo n.º 2
0
int main(int argc, char** argv){
//	t.init();
#define WITH_GL
#ifdef WITH_GL
	init(argc, argv);
	glutMouseFunc(mouse);

	glutTimerFunc(1000/60, mainLoop, 1);
	glutMainLoop();
#endif
	for(int i = 0; i < 1195; i++){
//		t.grow();
#ifdef WITH_GL
		t.draw();
#else
		t.transport();	// jedna tura gry
		if(i%192 == 0){
			std::cout << "round " << i/192 << "\n\n";
			t.print();
			std::cout << std::endl;
			std::cout << std::endl;
			std::cout << std::endl;
		}
//		getchar();
#endif
	}
	return 0;
}
Ejemplo n.º 3
0
void renderScene(void) {
	glMatrixMode(GL_MODELVIEW);
	t.draw();
}