glut - fps counter
Hey im making a little test program usung glut.
the problem is render is only called one it needed.
is there a way i can make it always be called as soon as possible so i can make a little benchmark app?
cheers
Set the idle function to request a redisplay. Unfortunately you can't just pass glutPostRedisplay to glutIdleFunc, but wrapping it is trivial:
In general, all your update code should be in the idle function, not the display function, i.e.:
Enigma
void redisplay(){ glutPostRedisplay();}int main(){ // ... glutIdleFunc(redisplay); // ...}
In general, all your update code should be in the idle function, not the display function, i.e.:
void update(){ // update all objects glutPostRedisplay();}void render(){ // just render objects}int main(){ // ... glutIdleFunc(update); glutDisplayFunc(render); // ...}
Enigma
hrmm this causes bad flickering using VBO's and with vertex arrays doesnt even display any of my test triangle :-/
i thought there was some way to have some sort of game loop using glut?
i thought there was some way to have some sort of game loop using glut?
Glut has a game mode, but this just provides high-performance full-screen rendering. Do you enable double buffering? Constant update with single buffering will usually cause bad flicker.
Enigma
Enigma
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement