summaryrefslogtreecommitdiff
path: root/src/drivers/WinAPI/Fl_WinAPI_Gl_Window_Driver.H
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-03-13 08:56:23 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-03-13 08:56:35 +0100
commitb549cfaaea11ce5e881e2151a838c91a031ad9ba (patch)
treea8a34a8cd7270a4d4ca68bca08c1b6e6388220d4 /src/drivers/WinAPI/Fl_WinAPI_Gl_Window_Driver.H
parente8461a6191e0afa5fd96290856d1a056437469d0 (diff)
Separate platform init functions from platform-specific driver files
Diffstat (limited to 'src/drivers/WinAPI/Fl_WinAPI_Gl_Window_Driver.H')
-rw-r--r--src/drivers/WinAPI/Fl_WinAPI_Gl_Window_Driver.H64
1 files changed, 64 insertions, 0 deletions
diff --git a/src/drivers/WinAPI/Fl_WinAPI_Gl_Window_Driver.H b/src/drivers/WinAPI/Fl_WinAPI_Gl_Window_Driver.H
new file mode 100644
index 000000000..efece9d19
--- /dev/null
+++ b/src/drivers/WinAPI/Fl_WinAPI_Gl_Window_Driver.H
@@ -0,0 +1,64 @@
+//
+// Class Fl_Wayland_Gl_Window_Driver for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 2021-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
+//
+
+#ifndef FL_WINAPI_GL_WINDOW_DRIVER_H
+#define FL_WINAPI_GL_WINDOW_DRIVER_H
+
+#include <config.h>
+#if HAVE_GL
+#include <FL/platform.H>
+#include "../../Fl_Gl_Window_Driver.H"
+#include <FL/gl.h>
+
+/* Implementation note about OpenGL drawing on the Wayland platform
+
+After eglCreateWindowSurface() with attributes {EGL_RENDER_BUFFER, EGL_SINGLE_BUFFER, EGL_NONE},
+eglQueryContext() reports that EGL_RENDER_BUFFER equals EGL_BACK_BUFFER.
+This experiment suggests that the platform only supports double-buffer drawing.
+Consequently, FL_DOUBLE is enforced in all Fl_Gl_Window::mode_ values under Wayland.
+*/
+
+class Fl_WinAPI_Gl_Window_Driver : public Fl_Gl_Window_Driver {
+ friend class Fl_Gl_Window_Driver;
+ Fl_WinAPI_Gl_Window_Driver(Fl_Gl_Window *win) : Fl_Gl_Window_Driver(win) {}
+ virtual float pixels_per_unit();
+ virtual int mode_(int m, const int *a);
+ virtual void make_current_after();
+ virtual void swap_buffers();
+ virtual void invalidate() {}
+ virtual int flush_begin(char& valid_f);
+ virtual Fl_Gl_Choice *find(int m, const int *alistp);
+ virtual GLContext create_gl_context(Fl_Window* window, const Fl_Gl_Choice* g, int layer = 0);
+ virtual void set_gl_context(Fl_Window* w, GLContext context);
+ virtual void delete_gl_context(GLContext);
+ virtual void make_overlay_current();
+ virtual void redraw_overlay();
+ virtual void* GetProcAddress(const char *procName);
+ virtual void draw_string_legacy(const char* str, int n);
+ virtual void gl_bitmap_font(Fl_Font_Descriptor *fl_fontsize);
+ virtual void get_list(Fl_Font_Descriptor *fd, int r);
+ virtual int genlistsize();
+#if HAVE_GL_OVERLAY
+ virtual void gl_hide_before(void *& overlay);
+ virtual int can_do_overlay();
+ virtual int overlay_color(Fl_Color i);
+ void make_overlay(void*&overlay);
+#endif
+};
+
+#endif // HAVE_GL
+
+#endif // FL_WINAPI_GL_WINDOW_DRIVER_H