From 1e761c7b4491377fe9c91a37c438856178cc4f8e Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Fri, 28 Jul 2017 10:45:20 +1000 Subject: Finished up FLTK.Images and partially complete derivatives --- src/c_fl_image.cpp | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'src/c_fl_image.cpp') diff --git a/src/c_fl_image.cpp b/src/c_fl_image.cpp index 3323c25..f3daf7f 100644 --- a/src/c_fl_image.cpp +++ b/src/c_fl_image.cpp @@ -6,6 +6,14 @@ +class My_Image : public Fl_Image { + public: + friend void fl_image_draw_empty(IMAGE i, int x, int y); +}; + + + + IMAGE new_fl_image(int w, int h, int d) { Fl_Image *i = new Fl_Image(w, h, d); return i; @@ -41,6 +49,19 @@ void fl_image_inactive(IMAGE i) { reinterpret_cast(i)->inactive(); } +int fl_image_fail(IMAGE i) { + switch (reinterpret_cast(i)->fail()) { + case Fl_Image::ERR_NO_IMAGE: + return 1; + case Fl_Image::ERR_FILE_ACCESS: + return 2; + case Fl_Image::ERR_FORMAT: + return 3; + default: + return 0; + } +} + @@ -56,3 +77,18 @@ int fl_image_d(IMAGE i) { return reinterpret_cast(i)->d(); } + + + +void fl_image_draw(IMAGE i, int x, int y) { + reinterpret_cast(i)->draw(x, y); +} + +void fl_image_draw2(IMAGE i, int x, int y, int w, int h, int cx, int cy) { + reinterpret_cast(i)->draw(x, y, w, h, cx, cy); +} + +void fl_image_draw_empty(IMAGE i, int x, int y) { + reinterpret_cast(i)->draw_empty(x, y); +} + -- cgit