summaryrefslogtreecommitdiff
path: root/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.H
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2022-02-06 15:22:24 +0100
committerGitHub <noreply@github.com>2022-02-06 15:22:24 +0100
commitdb0a1f4baeb928b54d328d5dfbd0ec37b0b58bd3 (patch)
treeed53495f5dd435d7c23cd4267fb785e5ebca679c /src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.H
parentaf4954aee3483f03ff69e990e80f4e4a18e8b7f6 (diff)
OpenGL implementation of all `fl_` "Drawing Fast Shapes" graphics calls (#385)
* Fix build system for unites, * Updated unittest to check OpenGL drawing. Making sure that OpenGL drawing is exactly the same as native drawing to make FLTK widget rendering look the same in GL windows. * Make OpenGL optional. * Implemented clipping in OpenGL * unites drawing fast shapes * Fixed CMake * Updating unittest. Added tests for fl_pi and fl_arc (int) Renamed tab to render complex shapes. * Improved OpenGL FLTK drawing emulation. * Fixed GTK ROUND DOWN BOX * Fixing Makefile for unittest * Correctly aligning OpenGL text. * Fixed text alignment in GL windows. Explained the "FLTK over GL " example in Cube. * Overlapping test. * Better GL graphics alignment. * Drawing the focus rect. * Adding Alpha Channel support for GL. * Added FLTK-on-GL documentation.
Diffstat (limited to 'src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.H')
-rw-r--r--src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.H19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.H b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.H
index b3c7e9de7..274d911dc 100644
--- a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.H
+++ b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.H
@@ -24,12 +24,20 @@
#define FL_OPENGL_GRAPHICS_DRIVER_H
#include <FL/Fl_Graphics_Driver.H>
+#include <FL/fl_draw.H>
/**
\brief OpenGL specific graphics class.
*/
class FL_EXPORT Fl_OpenGL_Graphics_Driver : public Fl_Graphics_Driver {
public:
+ float pixels_per_unit_;
+ float line_width_;
+ int line_stipple_;
+ Fl_OpenGL_Graphics_Driver() :
+ pixels_per_unit_(1.0f),
+ line_width_(1.0f),
+ line_stipple_(FL_SOLID) { }
// --- line and polygon drawing with integer coordinates
void point(int x, int y);
void rect(int x, int y, int w, int h);
@@ -46,10 +54,17 @@ public:
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 focus_rect(int x, int y, int w, int h);
+ // ---- clipping
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 pop_clip();
+ void push_no_clip();
+ Fl_Region clip_region();
+ void clip_region(Fl_Region r);
void restore_clip();
+ int not_clipped(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);
+ // ---- matrix transformed drawing
void transformed_vertex(double xf, double yf);
void begin_points();
void end_points();