Redraw OpenGL window at 60 fps (Vsync On)

조회수 25회
읽지 않은 첫 메시지로 건너뛰기

FOSS Dev

읽지 않음,
2020. 10. 10. 오전 4:36:4720. 10. 10.
받는사람 fltk.general
Hi i am new to FLTK but i want to know how can i make a render loop that automatically redraw OpenGL window at a constant frame rate.
Thanks

Manolo

읽지 않음,
2020. 10. 10. 오전 6:25:5720. 10. 10.
받는사람 fltk.general
#include <FL/Fl_Gl_Window.H>
#include <FL/Fl.H>

Fl_Gl_Window *my_gl_window = ....
my_gl_window->show();
while (1) {
  Fl::wait(1./60); // that would give 60 redraws per second
  my_gl_window->redraw();
  }

imm

읽지 않음,
2020. 10. 12. 오전 8:22:3820. 10. 12.
받는사람 general fltk
I think, if I were doing it like this, I might look at using the
Fl::add_timeout() mechanism to trigger the redraw of the GL window
(though I'm certain Manolo knows that!)
전체답장
작성자에게 답글
전달
새 메시지 0개