diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-08-20 17:26:02 +0200 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-08-20 17:26:02 +0200 |
| commit | d5a1e7feb98f0d3efc17ea755a5f94d008cd4f80 (patch) | |
| tree | e1e2d4d00815f278588c17ac108cc66c14c3f2c8 /src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx | |
| parent | 7deff86b5d70ca3f8a1ed4cbbc251c7fa31444dd (diff) | |
Add static Fl_Wayland_Window_Driver::gl_plugin() member function.
Diffstat (limited to 'src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx')
| -rw-r--r-- | src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx index d9b6d1486..b935fe604 100644 --- a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx +++ b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx @@ -98,14 +98,7 @@ Fl_Wayland_Window_Driver::~Fl_Wayland_Window_Driver() } delete_cursor_(); if (gl_start_support_) { // occurs only if gl_start/gl_finish was used - static Fl_Wayland_Plugin *plugin = NULL; - if (!plugin) { - Fl_Plugin_Manager pm("wayland.fltk.org"); - plugin = (Fl_Wayland_Plugin*)pm.plugin("gl.wayland.fltk.org"); - } - if (plugin) { - plugin->destroy(gl_start_support_); - } + gl_plugin()->destroy(gl_start_support_); } } @@ -388,15 +381,8 @@ void Fl_Wayland_Window_Driver::flush() { Fl_Wayland_Window_Driver::in_flush = true; Fl_Window_Driver::flush(); Fl_Wayland_Window_Driver::in_flush = false; - static Fl_Wayland_Plugin *plugin = NULL; - if (!plugin) { - Fl_Plugin_Manager pm("wayland.fltk.org"); - plugin = (Fl_Wayland_Plugin*)pm.plugin("gl.wayland.fltk.org"); - } - if (plugin) { - plugin->do_swap(pWindow); // useful only for GL win with overlay - if (scale != fl_graphics_driver->scale() || W != pWindow->w() || H != pWindow->h()) plugin->invalidate(pWindow); - } + gl_plugin()->do_swap(pWindow); // useful only for GL win with overlay + if (scale != fl_graphics_driver->scale() || W != pWindow->w() || H != pWindow->h()) gl_plugin()->invalidate(pWindow); return; } struct wld_window *window = fl_xid(pWindow); @@ -1531,3 +1517,13 @@ cairo_t *fl_wl_cairo() { struct wl_display *fl_wl_display() { return Fl_Wayland_Screen_Driver::wl_display; } + + +Fl_Wayland_Plugin *Fl_Wayland_Window_Driver::gl_plugin() { + static Fl_Wayland_Plugin *plugin = NULL; + if (!plugin) { + Fl_Plugin_Manager pm("wayland.fltk.org"); + plugin = (Fl_Wayland_Plugin*)pm.plugin("gl.wayland.fltk.org"); + } + return plugin; +} |
