开发者

How can you animate in OpenGL without using the idle function glutIdleFunc()?

开发者 https://www.devze.com 2022-12-18 14:48 出处:网络
Basically, what is another metho开发者_如何转开发d for animating besides idle?Pseudocode while(!application_end) {

Basically, what is another metho开发者_如何转开发d for animating besides idle?


Pseudocode

while(!application_end) {
  old_time = time;
  time = get_time();
  update_scene( time - old_time );
  draw_scene();
  flush_output();
  sleep(1); 
}

... and this is the heart of 99.99% serious OpenGL programs...

P.S. glut is not OpenGL, it's an addon library over OpenGL for abstraction over the OS.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号