diff options
| author | Manolo Gouy <Manolo> | 2018-02-07 15:34:44 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2018-02-07 15:34:44 +0000 |
| commit | dcc82d8926e447e422f200d01e1aa990233bc16a (patch) | |
| tree | bc0d120f1381e0e8c0ef5c66262289e93d3b9a08 /FL/Fl_Gl_Window_Driver.H | |
| parent | 90630409cbe8740d2c8b66823757a4ea5441aa21 (diff) | |
STR#3450: Draw text with OpenGL using textures on all platforms.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12650 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL/Fl_Gl_Window_Driver.H')
| -rw-r--r-- | FL/Fl_Gl_Window_Driver.H | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/FL/Fl_Gl_Window_Driver.H b/FL/Fl_Gl_Window_Driver.H index 7ef89487e..63d08fedf 100644 --- a/FL/Fl_Gl_Window_Driver.H +++ b/FL/Fl_Gl_Window_Driver.H @@ -4,7 +4,7 @@ // Definition of class Fl_Gl_Window_Driver, and of its platform-specific derived classes // for the Fast Light Tool Kit (FLTK). // -// Copyright 2016-2017 by Bill Spitzak and others. +// Copyright 2016-2018 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 @@ -44,7 +44,7 @@ public: void alist(const int *l) { pWindow->alist = l;} void* overlay() {return pWindow->overlay;} void draw_overlay() {pWindow->draw_overlay();} - + Fl_Gl_Window_Driver(Fl_Gl_Window *win) : pWindow(win) {} virtual ~Fl_Gl_Window_Driver() {} static Fl_Gl_Window_Driver *newGlWindowDriver(Fl_Gl_Window *w); @@ -79,10 +79,17 @@ public: virtual void gl_visual(Fl_Gl_Choice*); // support for Fl::gl_visual() function virtual void gl_start() {} // support for gl_start() function virtual void* GetProcAddress(const char *procName); // support for glutGetProcAddress() - virtual void draw_string(const char* str, int n); // support for gl_draw() + virtual void draw_string_legacy(const char* str, int n); // support for gl_draw() + void draw_string_legacy_get_list(const char* str, int n); // support for gl_draw() + static void draw_string_legacy_glut(const char* str, int n); // support for gl_draw() virtual void get_list(Fl_Font_Descriptor* fd, int r) {} // support for gl_draw() without textures virtual void gl_bitmap_font(Fl_Font_Descriptor *fl_fontsize) {} // support for gl_font() without textures virtual int overlay_color(Fl_Color i) {return 0;} // support for gl_color() with HAVE_GL_OVERLAY + static void draw_string_with_texture(const char* str, int n); // cross-platform + // support for gl_draw(). The cross-platform version may be enough. + virtual char *alpha_mask_for_string(const char *str, int n, int w, int h); + virtual int genlistsize() { return 0; } // support for gl_draw() + virtual Fl_Font_Descriptor** fontnum_to_fontdescriptor(int fnum); }; #ifdef FL_CFG_GFX_QUARTZ @@ -111,13 +118,13 @@ class Fl_Cocoa_Gl_Window_Driver : public Fl_Gl_Window_Driver { virtual void make_overlay_current(); virtual void redraw_overlay(); virtual void gl_start(); - virtual void draw_string(const char* str, int n); static NSOpenGLContext* create_GLcontext_for_window(NSOpenGLPixelFormat *pixelformat, NSOpenGLContext *shared_ctx, Fl_Window *window); static NSOpenGLPixelFormat *mode_to_NSOpenGLPixelFormat(int mode, const int*); // uses Objective-c static void GLcontext_update(NSOpenGLContext*); // uses Objective-c static void GLcontext_release(NSOpenGLContext*); // uses Objective-c static void GLcontext_makecurrent(NSOpenGLContext*); // uses Objective-c static void GL_cleardrawable(void); // uses Objective-c + virtual char *alpha_mask_for_string(const char *str, int n, int w, int h); }; #endif // FL_CFG_GFX_QUARTZ @@ -141,8 +148,10 @@ class Fl_WinAPI_Gl_Window_Driver : public Fl_Gl_Window_Driver { 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 int can_do_overlay(); virtual int overlay_color(Fl_Color i); @@ -153,7 +162,7 @@ class Fl_WinAPI_Gl_Window_Driver : public Fl_Gl_Window_Driver { #ifdef FL_CFG_GFX_XLIB -#include <X11/Xutil.h> +#include <X11/Xutil.h> // for XVisualInfo class Fl_X11_Gl_Window_Driver : public Fl_Gl_Window_Driver { friend class Fl_Gl_Window_Driver; Fl_X11_Gl_Window_Driver(Fl_Gl_Window *win) : Fl_Gl_Window_Driver(win) {} @@ -178,9 +187,14 @@ class Fl_X11_Gl_Window_Driver : public Fl_Gl_Window_Driver { virtual void waitGL(); virtual void gl_visual(Fl_Gl_Choice*); // support for Fl::gl_visual() virtual void gl_start(); + 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); -public: + virtual int genlistsize(); +#if !USE_XFT + virtual Fl_Font_Descriptor** fontnum_to_fontdescriptor(int fnum); +#endif + public: static GLContext create_gl_context(XVisualInfo* vis); }; |
