New public static variable bool Fl_Image::register_images_done

Allows an app to detect whether fl_register_images() was called or not.
This commit is contained in:
ManoloFLTK 2020-01-30 18:54:18 +01:00
parent fbf20b7225
commit 325c4b8666
3 changed files with 4 additions and 0 deletions

View File

@ -226,6 +226,7 @@ public:
static void scaling_algorithm(Fl_RGB_Scaling algorithm) {scaling_algorithm_ = algorithm; }
/** Gets what algorithm is used when resizing a source image to draw it. */
static Fl_RGB_Scaling scaling_algorithm() {return scaling_algorithm_;}
static bool register_images_done;
};

View File

@ -297,6 +297,8 @@ int Fl_Image::draw_scaled(int X, int Y, int W, int H) {
return 1;
}
/** True after fl_register_images() was called, false before */
bool Fl_Image::register_images_done = false;
//
// RGB image class...

View File

@ -57,6 +57,7 @@ static Fl_Image *fl_check_images(const char *name, uchar *header, int headerlen)
*/
void fl_register_images() {
Fl_Shared_Image::add_handler(fl_check_images);
Fl_Image::register_images_done = true;
}