Hi
Ok ive simulated a solar system with the planets and moons etc… orbiting the sun. The problem is it goes way to fast, i don’t want to solve this by changing variables thouh. I’d like some kind of frame limiter so that it works the same on any system…
Ive tried using glutTimerFunc but i can’t seem to get it working right…
Where should I actually be calling this function
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize(800 , 600);
glutInitWindowPosition(10, 100);
glutCreateWindow(argv[0]);
init();
glutDisplayFunc(display);
glutReshapeFunc(reshape);
glutKeyboardFunc(keyboard);
glutSpecialFunc(specialKeys);
glutMouseFunc(mouse);
glutMainLoop();
return 0;
}
this is my main. I have a Init function with all my vertex arrays etc… and all the animation happens in the render function…
where should i actually be placing the glutTimerFunc to ensure it slows my animation to 60fps. I know ill have to create a timer function, and call it in the main but then what…
Thanks in advance