diff options
Diffstat (limited to 'src/drivers/OpenGL')
10 files changed, 111 insertions, 46 deletions
diff --git a/src/drivers/OpenGL/Fl_OpenGL_Display_Device.cxx b/src/drivers/OpenGL/Fl_OpenGL_Display_Device.cxx index bd2ab3b58..707bd1e52 100644 --- a/src/drivers/OpenGL/Fl_OpenGL_Display_Device.cxx +++ b/src/drivers/OpenGL/Fl_OpenGL_Display_Device.cxx @@ -22,8 +22,8 @@ #include <FL/Fl_Device.H> #include <FL/gl.h> -#include "Fl_OpenGL_Graphics_Driver.h" -#include "Fl_OpenGL_Display_Device.h" +#include "Fl_OpenGL_Graphics_Driver.H" +#include "Fl_OpenGL_Display_Device.H" // TODO: much of Fl_Gl_Choice should probably go here diff --git a/src/drivers/OpenGL/Fl_OpenGL_Display_Device.h b/src/drivers/OpenGL/Fl_OpenGL_Display_Device.h deleted file mode 100644 index 9730fc9c4..000000000 --- a/src/drivers/OpenGL/Fl_OpenGL_Display_Device.h +++ /dev/null @@ -1,37 +0,0 @@ -// -// "$Id$" -// -// implementation of class Fl_Gl_Device_Plugin for the Fast Light Tool Kit (FLTK). -// -// Copyright 2010-2014 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: -// -// http://www.fltk.org/COPYING.php -// -// Please report all bugs and problems to: -// -// http://www.fltk.org/str.php -// - - -#include <FL/Fl_Device.H> - -class Fl_OpenGL_Graphics_Driver; - -/** - OpenGL Surface. - This surface is needed as an interface between GL windows and the GL graphics driver. - */ -class FL_EXPORT Fl_OpenGL_Display_Device : public Fl_Surface_Device { -public: - Fl_OpenGL_Display_Device(Fl_OpenGL_Graphics_Driver *graphics_driver); - static Fl_OpenGL_Display_Device *display_device(); -}; - - -// -// End of "$Id$". -// diff --git a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.H b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.H new file mode 100644 index 000000000..b12e661f9 --- /dev/null +++ b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.H @@ -0,0 +1,102 @@ +// +// "$Id$" +// +// Definition of OpenGL graphics driver +// for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2016 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: +// +// http://www.fltk.org/COPYING.php +// +// Please report all bugs and problems on the following page: +// +// http://www.fltk.org/str.php +// + +/** + \file opengl.H + \brief Definition of OpenGL graphics driver. + */ + +#ifndef FL_CFG_GFX_OPENGL_H +#define FL_CFG_GFX_OPENGL_H + +#include <FL/Fl_Graphics_Driver.H> + + +/** + \brief OpenGL specific graphics class. + */ +class FL_EXPORT Fl_OpenGL_Graphics_Driver : public Fl_Graphics_Driver { +public: + // --- line and polygon drawing with integer coordinates + void point(int x, int y); + void rect(int x, int y, int w, int h); + void rectf(int x, int y, int w, int h); + void line(int x, int y, int x1, int y1); + void line(int x, int y, int x1, int y1, int x2, int y2); + void xyline(int x, int y, int x1); + void xyline(int x, int y, int x1, int y2); + void xyline(int x, int y, int x1, int y2, int x3); + void yxline(int x, int y, int y1); + void yxline(int x, int y, int y1, int x2); + void yxline(int x, int y, int y1, int x2, int y3); + void loop(int x0, int y0, int x1, int y1, int x2, int y2); + void loop(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3); + void polygon(int x0, int y0, int x1, int y1, int x2, int y2); + void polygon(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3); + void push_clip(int x, int y, int w, int h); + int clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H); + int not_clipped(int x, int y, int w, int h); + void push_no_clip(); + void pop_clip(); + void restore_clip(); + // --- implementation is in src/fl_vertex.cxx which includes src/cfg_gfx/xxx_rect.cxx + void transformed_vertex0(COORD_T x, COORD_T y); + void transformed_vertex(double xf, double yf); + void vertex(double x, double y); + void begin_points(); + void end_points(); + void begin_line(); + void end_line(); + void begin_loop(); + void end_loop(); + void begin_polygon(); + void end_polygon(); + void begin_complex_polygon(); + void gap(); + void end_complex_polygon(); + void fixloop(); + void circle(double x, double y, double r); + // --- implementation is in src/fl_arc.cxx which includes src/cfg_gfx/xxx_arc.cxx if needed + // using void Fl_Graphics_Driver::arc(double x, double y, double r, double start, double end); + // --- implementation is in src/fl_arci.cxx which includes src/cfg_gfx/xxx_arci.cxx + void arc(int x, int y, int w, int h, double a1, double a2); + void pie(int x, int y, int w, int h, double a1, double a2); + // --- implementation is in src/fl_line_style.cxx which includes src/cfg_gfx/xxx_line_style.cxx + void line_style(int style, int width=0, char* dashes=0); + // --- implementation is in src/fl_color.cxx which includes src/cfg_gfx/xxx_color.cxx + void color(Fl_Color c); + Fl_Color color() { return color_; } + void color(uchar r, uchar g, uchar b); + // --- implementation is in src/fl_font.cxx which includes src/cfg_gfx/xxx_font.cxx + void draw(const char *str, int n, int x, int y); + double width(const char *str, int n); + void text_extents(const char*, int n, int& dx, int& dy, int& w, int& h); + int height(); + int descent(); + // --- + Fl_Bitmask create_bitmask(int w, int h, const uchar *array) { return 0L; } + void delete_bitmask(Fl_Bitmask bm) { }; +}; + + +#endif // FL_CFG_GFX_OPENGL_H + +// +// End of "$Id$". +// diff --git a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.cxx b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.cxx index af0d3935c..227b50de3 100644 --- a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.cxx +++ b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.cxx @@ -20,7 +20,7 @@ #define FL_CFG_GFX_OPENGL_CXX #include <FL/gl.h> -#include "Fl_OpenGL_Graphics_Driver.h" +#include "Fl_OpenGL_Graphics_Driver.H" #endif // FL_CFG_GFX_OPENGL_RECT_CXX diff --git a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_arci.cxx b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_arci.cxx index e77c7d5ff..649f18398 100644 --- a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_arci.cxx +++ b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_arci.cxx @@ -26,7 +26,7 @@ #include <config.h> #include "../../config_lib.h" -#include "Fl_OpenGL_Graphics_Driver.h" +#include "Fl_OpenGL_Graphics_Driver.H" #include <FL/gl.h> #include <FL/Fl_Gl_Window.H> #include <FL/Fl_RGB_Image.H> diff --git a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_color.cxx b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_color.cxx index a08507c93..b80290490 100644 --- a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_color.cxx +++ b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_color.cxx @@ -23,7 +23,7 @@ #include <config.h> #include "../../config_lib.h" -#include "Fl_OpenGL_Graphics_Driver.h" +#include "Fl_OpenGL_Graphics_Driver.H" #include <FL/gl.h> #include <FL/Fl_Gl_Window.H> #include <FL/Fl_RGB_Image.H> diff --git a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_font.cxx b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_font.cxx index 7209cbd7b..13f9d5ac6 100644 --- a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_font.cxx +++ b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_font.cxx @@ -29,7 +29,7 @@ #include <config.h> #include "../../config_lib.h" -#include "Fl_OpenGL_Graphics_Driver.h" +#include "Fl_OpenGL_Graphics_Driver.H" #include <FL/gl.h> #include <FL/Fl_Gl_Window.H> #include <FL/Fl_RGB_Image.H> diff --git a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_line_style.cxx b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_line_style.cxx index daebb2e21..b3eea4eb6 100644 --- a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_line_style.cxx +++ b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_line_style.cxx @@ -26,7 +26,7 @@ #include <config.h> #include "../../config_lib.h" -#include "Fl_OpenGL_Graphics_Driver.h" +#include "Fl_OpenGL_Graphics_Driver.H" #include <FL/gl.h> #include <FL/Fl_Gl_Window.H> #include <FL/Fl_RGB_Image.H> diff --git a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_rect.cxx b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_rect.cxx index 8536d4901..7a1a28da7 100644 --- a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_rect.cxx +++ b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_rect.cxx @@ -27,7 +27,7 @@ #include <config.h> #include "../../config_lib.h" -#include "Fl_OpenGL_Graphics_Driver.h" +#include "Fl_OpenGL_Graphics_Driver.H" #include <FL/gl.h> #include <FL/Fl_Gl_Window.H> #include <FL/Fl_RGB_Image.H> diff --git a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_vertex.cxx b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_vertex.cxx index 1dd091f0d..76fd3cf4a 100644 --- a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_vertex.cxx +++ b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_vertex.cxx @@ -25,7 +25,7 @@ simple 2D transformations, implemented for OpenGL. */ -#include "Fl_OpenGL_Graphics_Driver.h" +#include "Fl_OpenGL_Graphics_Driver.H" #include <FL/fl_draw.H> #include <FL/gl.h> |
