I am making a simple FLTK application (in windows) that needs to display PNG images in FL_Window, load them one after the other from disk. I have this code as a starting point but its not displaying the image which I can confirm is in the same folder as the executable:
int main(int argc, char **argv) { Fl_Window *main_window = NULL; fl_register_images(); flw = new Fl_Window(1680,1050,title); Fl_Shared_Image *a = Fl_Shared_Image::get("picture.png"); if (a != NULL) { cout << "Image loaded" << endl; } else { cout << "No image loaded" << endl; // <==== This is printed } flw->begin(); // add image to window code here, not sure what to write but // image doesnt even load flw->end(); main_window->show(); int fl_ret = Fl::run(); return fl_ret; } Any help greatly appreciated ..
main_window->show();. That said, you got good answers anyway, I can't add much to the answers below.