summaryrefslogtreecommitdiff
path: root/src/drivers/GDI/Fl_GDI_Graphics_Driver.H
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2021-02-26 18:00:07 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2021-05-31 08:28:06 +0200
commitb027d2ba57a8e0d6f0862e0a891ddd5dee4b02e2 (patch)
tree3ed894bd9a891337804367a09de500ff060be640 /src/drivers/GDI/Fl_GDI_Graphics_Driver.H
parentd95dd7acc4af3a4bd521d151ba3576b91d8ace53 (diff)
Windows platform: use GDI+ to antialias oblique lines and curves.
Diffstat (limited to 'src/drivers/GDI/Fl_GDI_Graphics_Driver.H')
-rw-r--r--src/drivers/GDI/Fl_GDI_Graphics_Driver.H47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver.H b/src/drivers/GDI/Fl_GDI_Graphics_Driver.H
index 76d9c5c01..824ad2fa7 100644
--- a/src/drivers/GDI/Fl_GDI_Graphics_Driver.H
+++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver.H
@@ -26,6 +26,16 @@
#include <FL/Fl_Graphics_Driver.H>
#include <windows.h>
#include <stdlib.h>
+#include <config.h>
+
+#if USE_GDIPLUS
+# if defined(_MSC_VER)
+# include <objidl.h>
+# else
+# include <wtypes.h> // for PROPID needed with gcc 4.9.0 but not with 4.9.3
+# endif
+# include <gdiplus.h>
+#endif
/**
\brief The Windows-specific graphics driver class.
@@ -164,5 +174,42 @@ public:
void copy_offscreen(int x, int y, int w, int h, Fl_Offscreen bitmap, int srcx, int srcy);
};
+#if USE_GDIPLUS
+
+class Fl_GDIplus_Graphics_Driver : public Fl_GDI_Graphics_Driver {
+private:
+ Gdiplus::Color gdiplus_color_;
+ Gdiplus::Pen *pen_;
+ Gdiplus::SolidBrush *brush_;
+public:
+ Fl_GDIplus_Graphics_Driver();
+ virtual ~Fl_GDIplus_Graphics_Driver();
+ bool active;
+ static void shutdown(void);
+virtual void color(Fl_Color c);
+virtual Fl_Color color() { return color_; }
+virtual void color(uchar r, uchar g, uchar b);
+ virtual void line(int x, int y, int x1, int y1);
+ virtual void line(int x, int y, int x1, int y1, int x2, int y2);
+ 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);
+ virtual void line_style(int style, int width, char* dashes);
+ virtual void arc_unscaled(int x, int y, int w, int h, double a1, double a2);
+ virtual void pie_unscaled(int x, int y, int w, int h, double a1, double a2);
+ virtual void transformed_vertex(double xf, double yf);
+ virtual void vertex(double x,double y);
+ virtual void end_points();
+ virtual void end_line();
+ virtual void end_loop();
+ virtual void end_polygon();
+ virtual void end_complex_polygon();
+ virtual void circle(double x, double y, double r);
+ virtual void antialias(int state);
+ virtual int antialias();
+};
+
+#endif // USE_GDIPLUS
#endif // FL_GDI_GRAPHICS_DRIVER_H