summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm6
-rw-r--r--src/drivers/Cocoa/fl_macOS_gl_platform_init.cxx24
-rw-r--r--src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx12
-rw-r--r--src/drivers/Wayland/fl_wayland_gl_platform_init.cxx36
-rw-r--r--src/drivers/WinAPI/Fl_WinAPI_Gl_Window_Driver.cxx6
-rw-r--r--src/drivers/WinAPI/fl_WinAPI_gl_platform_init.cxx24
-rw-r--r--src/drivers/X11/Fl_X11_Gl_Window_Driver.cxx7
-rw-r--r--src/drivers/X11/fl_X11_gl_platform_init.cxx24
8 files changed, 31 insertions, 108 deletions
diff --git a/src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm b/src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm
index 2420d12b0..f54871df8 100644
--- a/src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm
+++ b/src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm
@@ -56,6 +56,12 @@ Fl_Cocoa_Gl_Window_Driver::Fl_Cocoa_Gl_Window_Driver(Fl_Gl_Window *win) :
}
+Fl_Gl_Window_Driver *Fl_Gl_Window_Driver::newGlWindowDriver(Fl_Gl_Window *w)
+{
+ return new Fl_Cocoa_Gl_Window_Driver(w);
+}
+
+
static NSOpenGLPixelFormat* mode_to_NSOpenGLPixelFormat(int m, const int *alistp)
{
NSOpenGLPixelFormatAttribute attribs[32];
diff --git a/src/drivers/Cocoa/fl_macOS_gl_platform_init.cxx b/src/drivers/Cocoa/fl_macOS_gl_platform_init.cxx
deleted file mode 100644
index 421c665d2..000000000
--- a/src/drivers/Cocoa/fl_macOS_gl_platform_init.cxx
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// Wayland-specific code to initialize wayland support.
-//
-// Copyright 2022 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file. If this
-// file is missing or damaged, see the license at:
-//
-// https://www.fltk.org/COPYING.php
-//
-// Please see the following page on how to report bugs and issues:
-//
-// https://www.fltk.org/bugs.php
-//
-
-
-#include "Fl_Cocoa_Gl_Window_Driver.H"
-
-
-Fl_Gl_Window_Driver *Fl_Gl_Window_Driver::newGlWindowDriver(Fl_Gl_Window *w)
-{
- return new Fl_Cocoa_Gl_Window_Driver(w);
-}
diff --git a/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx
index 59f92663f..86aeee8b7 100644
--- a/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx
+++ b/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx
@@ -23,6 +23,9 @@
#include "Fl_Wayland_Window_Driver.H"
#include "Fl_Wayland_Graphics_Driver.H"
#include "Fl_Wayland_Gl_Window_Driver.H"
+#ifdef FLTK_USE_X11
+# include "../X11/Fl_X11_Gl_Window_Driver.H"
+#endif
#include <wayland-egl.h>
#include <EGL/egl.h>
#include <FL/gl.h>
@@ -73,6 +76,15 @@ Fl_Wayland_Gl_Window_Driver::Fl_Wayland_Gl_Window_Driver(Fl_Gl_Window *win) : Fl
}
+Fl_Gl_Window_Driver *Fl_Gl_Window_Driver::newGlWindowDriver(Fl_Gl_Window *w)
+{
+#ifdef FLTK_USE_X11
+ if (!Fl_Wayland_Screen_Driver::wl_display) return new Fl_X11_Gl_Window_Driver(w);
+#endif
+ return new Fl_Wayland_Gl_Window_Driver(w);
+}
+
+
void Fl_Wayland_Gl_Window_Driver::init() {
EGLint major, minor;
diff --git a/src/drivers/Wayland/fl_wayland_gl_platform_init.cxx b/src/drivers/Wayland/fl_wayland_gl_platform_init.cxx
deleted file mode 100644
index 1c734be47..000000000
--- a/src/drivers/Wayland/fl_wayland_gl_platform_init.cxx
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// Wayland-specific code to initialize wayland support.
-//
-// Copyright 2022 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file. If this
-// file is missing or damaged, see the license at:
-//
-// https://www.fltk.org/COPYING.php
-//
-// Please see the following page on how to report bugs and issues:
-//
-// https://www.fltk.org/bugs.php
-//
-
-#include <config.h>
-#if HAVE_GL
-
-#include "Fl_Wayland_Gl_Window_Driver.H"
-#include "Fl_Wayland_Screen_Driver.H"
-#ifdef FLTK_USE_X11
-#include "../X11/Fl_X11_Gl_Window_Driver.H"
-#endif
-
-Fl_Gl_Window_Driver *Fl_Gl_Window_Driver::newGlWindowDriver(Fl_Gl_Window *w)
-{
-#ifdef FLTK_USE_X11
- if (Fl_Wayland_Screen_Driver::wl_display) return new Fl_Wayland_Gl_Window_Driver(w);
- return new Fl_X11_Gl_Window_Driver(w);
-#else
- return new Fl_Wayland_Gl_Window_Driver(w);
-#endif
-}
-
-#endif // HAVE_GL
diff --git a/src/drivers/WinAPI/Fl_WinAPI_Gl_Window_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_Gl_Window_Driver.cxx
index 50af2208f..e941fa5a9 100644
--- a/src/drivers/WinAPI/Fl_WinAPI_Gl_Window_Driver.cxx
+++ b/src/drivers/WinAPI/Fl_WinAPI_Gl_Window_Driver.cxx
@@ -53,6 +53,12 @@ public:
};
+Fl_Gl_Window_Driver *Fl_Gl_Window_Driver::newGlWindowDriver(Fl_Gl_Window *w)
+{
+ return new Fl_WinAPI_Gl_Window_Driver(w);
+}
+
+
Fl_Gl_Choice *Fl_WinAPI_Gl_Window_Driver::find(int m, const int *alistp)
{
Fl_WinAPI_Gl_Choice *g = (Fl_WinAPI_Gl_Choice*)Fl_Gl_Window_Driver::find_begin(m, alistp);
diff --git a/src/drivers/WinAPI/fl_WinAPI_gl_platform_init.cxx b/src/drivers/WinAPI/fl_WinAPI_gl_platform_init.cxx
deleted file mode 100644
index f5b26be64..000000000
--- a/src/drivers/WinAPI/fl_WinAPI_gl_platform_init.cxx
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// Wayland-specific code to initialize wayland support.
-//
-// Copyright 2022 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file. If this
-// file is missing or damaged, see the license at:
-//
-// https://www.fltk.org/COPYING.php
-//
-// Please see the following page on how to report bugs and issues:
-//
-// https://www.fltk.org/bugs.php
-//
-
-
-#include "Fl_WinAPI_Gl_Window_Driver.H"
-
-
-Fl_Gl_Window_Driver *Fl_Gl_Window_Driver::newGlWindowDriver(Fl_Gl_Window *w)
-{
- return new Fl_WinAPI_Gl_Window_Driver(w);
-}
diff --git a/src/drivers/X11/Fl_X11_Gl_Window_Driver.cxx b/src/drivers/X11/Fl_X11_Gl_Window_Driver.cxx
index d0b79a09a..bbcebbd84 100644
--- a/src/drivers/X11/Fl_X11_Gl_Window_Driver.cxx
+++ b/src/drivers/X11/Fl_X11_Gl_Window_Driver.cxx
@@ -44,6 +44,13 @@ public:
}
};
+#ifndef FLTK_USE_WAYLAND
+Fl_Gl_Window_Driver *Fl_Gl_Window_Driver::newGlWindowDriver(Fl_Gl_Window *w)
+{
+ return new Fl_X11_Gl_Window_Driver(w);
+}
+#endif
+
void Fl_X11_Gl_Window_Driver::draw_string_legacy(const char* str, int n) {
draw_string_legacy_get_list(str, n);
}
diff --git a/src/drivers/X11/fl_X11_gl_platform_init.cxx b/src/drivers/X11/fl_X11_gl_platform_init.cxx
deleted file mode 100644
index 66cfb6989..000000000
--- a/src/drivers/X11/fl_X11_gl_platform_init.cxx
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// X11-specific code to initialize wayland support.
-//
-// Copyright 2022 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file. If this
-// file is missing or damaged, see the license at:
-//
-// https://www.fltk.org/COPYING.php
-//
-// Please see the following page on how to report bugs and issues:
-//
-// https://www.fltk.org/bugs.php
-//
-
-
-#include "Fl_X11_Gl_Window_Driver.H"
-
-
-Fl_Gl_Window_Driver *Fl_Gl_Window_Driver::newGlWindowDriver(Fl_Gl_Window *w)
-{
- return new Fl_X11_Gl_Window_Driver(w);
-}