From b027d2ba57a8e0d6f0862e0a891ddd5dee4b02e2 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Fri, 26 Feb 2021 18:00:07 +0100 Subject: Windows platform: use GDI+ to antialias oblique lines and curves. --- CMake/fl_create_example.cmake | 3 +++ CMake/options.cmake | 10 ++++++++++ 2 files changed, 13 insertions(+) (limited to 'CMake') diff --git a/CMake/fl_create_example.cmake b/CMake/fl_create_example.cmake index 22c418bc6..38ffe98e1 100644 --- a/CMake/fl_create_example.cmake +++ b/CMake/fl_create_example.cmake @@ -123,6 +123,9 @@ macro (CREATE_EXAMPLE NAME SOURCES LIBRARIES) target_link_directories (${TARGET_NAME} PRIVATE ${PKG_CAIRO_LIBRARY_DIRS}) endif() endif (FLTK_HAVE_CAIRO) + if (USE_GDIPLUS) # can only be true on Windows + target_link_libraries (${TARGET_NAME} gdiplus) + endif (USE_GDIPLUS) if (MAC_BUNDLE) if (PLIST) diff --git a/CMake/options.cmake b/CMake/options.cmake index cf50da6b8..e9e7a1db0 100644 --- a/CMake/options.cmake +++ b/CMake/options.cmake @@ -52,6 +52,16 @@ if (UNIX) list (APPEND FLTK_LDLIBS -lm) endif (UNIX) +if (WIN32) + option (OPTION_USE_GDIPLUS "use GDI+ when possible for antialiased graphics" ON) + if (OPTION_USE_GDIPLUS) + set (USE_GDIPLUS TRUE) + if (NOT MSVC) + list (APPEND FLTK_LDLIBS "-lgdiplus") + endif (NOT MSVC) + endif (OPTION_USE_GDIPLUS) +endif (WIN32) + ####################################################################### if (APPLE) option (OPTION_APPLE_X11 "use X11" OFF) -- cgit v1.2.3