Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to replace glutMainLoop() with simple loop?

Tags:

opengl

glut

Is it possible to replace glutMainLoop() with simple loop ( e.g. while or for ) and in this loop just call all callbacks?

I have done this and picture is displaying fine but window ( in which is picture displayed ) is not responding ( can not move it ).

Does glutMainLoop() call more than callbacks?

like image 869
user1281071 Avatar asked May 21 '12 10:05

user1281071


1 Answers

If you're using FreeGLUT, you can use glutMainLoopEvent. It does one cycle of processing of the event loop, so you can call it in a loop.

while(...)
{
  glutMainLoopEvent();
  //do other stuff.
}
like image 129
Nicol Bolas Avatar answered Sep 17 '22 12:09

Nicol Bolas