summaryrefslogtreecommitdiff
path: root/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx
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/GDI/Fl_GDI_Graphics_Driver.cxx
parente8461a6191e0afa5fd96290856d1a056437469d0 (diff)
Separate platform init functions from platform-specific driver files
Diffstat (limited to 'src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx')
-rw-r--r--src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx23
1 files changed, 4 insertions, 19 deletions
diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx
index 484830e2a..caa8d6746 100644
--- a/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx
+++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx
@@ -24,7 +24,6 @@
#include "Fl_Font.H"
#if USE_GDIPLUS
-static ULONG_PTR gdiplusToken = 0;
Fl_GDIplus_Graphics_Driver::Fl_GDIplus_Graphics_Driver() : Fl_GDI_Graphics_Driver() {
if (!fl_current_xmap) color(FL_BLACK);
@@ -51,27 +50,13 @@ int Fl_GDIplus_Graphics_Driver::antialias() {
#endif
-/*
- * By linking this module, the following static method will instantiate the
- * Windows GDI Graphics driver as the main display driver.
- */
-Fl_Graphics_Driver *Fl_Graphics_Driver::newMainGraphicsDriver()
-{
-#if USE_GDIPLUS
- // Initialize GDI+.
- static Gdiplus::GdiplusStartupInput gdiplusStartupInput;
- if (gdiplusToken == 0) GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
-
- Fl_Graphics_Driver *driver = new Fl_GDIplus_Graphics_Driver();
- return driver;
-#else
- return new Fl_GDI_Graphics_Driver();
-#endif
-}
#if USE_GDIPLUS
+
+ULONG_PTR Fl_GDIplus_Graphics_Driver::gdiplusToken = 0;
+
void Fl_GDIplus_Graphics_Driver::shutdown() {
- Gdiplus::GdiplusShutdown(gdiplusToken);
+ Gdiplus::GdiplusShutdown(Fl_GDIplus_Graphics_Driver::gdiplusToken);
}
#endif