diff options
| author | Matthias Melcher <github@matthiasm.com> | 2023-11-26 12:37:59 +0100 |
|---|---|---|
| committer | Matthias Melcher <github@matthiasm.com> | 2023-11-26 12:37:59 +0100 |
| commit | 6817e821af9d69363466025f17ee367cfaa4550e (patch) | |
| tree | 0ccee8a354141b7e5eefac83da657c030e1a9f9e /src/Fl_Gl_Window.cxx | |
| parent | 102437f1eedce8589d947bf8791d6d5f413d445b (diff) | |
STR 1373: adds vsync control to OpenGL contexts on macOS
Windows and X11 to follow, no idea about Wayland.
Diffstat (limited to 'src/Fl_Gl_Window.cxx')
| -rw-r--r-- | src/Fl_Gl_Window.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/Fl_Gl_Window.cxx b/src/Fl_Gl_Window.cxx index a3c2641bd..b59d7d5de 100644 --- a/src/Fl_Gl_Window.cxx +++ b/src/Fl_Gl_Window.cxx @@ -161,6 +161,21 @@ void Fl_Gl_Window::swap_buffers() { pGlWindowDriver->swap_buffers(); } +/** + Sets the rate at which the GL windows swaps buffers. + */ +void Fl_Gl_Window::swap_interval(int frames) { + pGlWindowDriver->swap_interval(frames); +} + +/** + Gets the rate at which the GL windows swaps buffers. + */ +int Fl_Gl_Window::swap_interval() const { + return pGlWindowDriver->swap_interval(); +} + + void Fl_Gl_Window::flush() { if (!shown()) return; uchar save_valid = valid_f_ & 1; |
