From b1cff66e86566bbed8897b0edb9873b93ccbc08b Mon Sep 17 00:00:00 2001 From: Greg Ercolano Date: Mon, 30 Oct 2017 03:57:33 +0000 Subject: [PATCH] Added check if nanosvg is enabled or not. The example posts a warning dialog if it's not (vis a vis test/cube demo) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12535 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- examples/howto-simple-svg.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/howto-simple-svg.cxx b/examples/howto-simple-svg.cxx index 28535856c..6b7c6bc11 100644 --- a/examples/howto-simple-svg.cxx +++ b/examples/howto-simple-svg.cxx @@ -16,11 +16,13 @@ // // http://www.fltk.org/str.php // +#include /* needed only to detect FLTK_USE_NANOSVG */ #include #include #include #include #include +#include /* svg logo */ const char *svg_logo = @@ -53,6 +55,10 @@ const char *svg_logo = "\n"; int main(int argc, char **argv) { +#ifndef FLTK_USE_NANOSVG + fl_message("You need to build fltk with --enable-nanosvg to use this example."); + return(1); +#else Fl_SVG_Image *svg = new Fl_SVG_Image(NULL, (char*)strdup(svg_logo)); // XXX: strdup() shouldn't be needed -- see STR #3421 Fl_Window *win = new Fl_Window(720, 486, "svg test"); Fl_Box *box = new Fl_Box(10,10,720-20,486-20); @@ -60,6 +66,7 @@ int main(int argc, char **argv) { win->end(); win->show(argc,argv); return(Fl::run()); +#endif } //