0

I have made an application in c++, using FLTK 1.3.2 on Mac OSX and am happy with its functionality and now need to produce a Win32 version (a motivating reason for using FLTK)

I can get basic FLTK code to run on Windows now, but have come up against several issues:

1) Despite building my project as a release version whenever I launch the application is launches out of a command prompt. How do I stop this?

2) On Mac all resources can be included in the app bundle and then loaded as files from the app bundle path. Is seems that there is no equivalent in Windows; I have to include images (for instance) as a resource. The problem is that two distinct bits of functionality need a path to the image I want to use namely:

a) Fl_PNG_Image class where the syntax is Fl_PNG_Image a_guide("path/myfile.png");

b) SOIL image loader where the syntax is texture= SOIL_load_OGL_texture("path/myfile.png", SOIL_LOAD_AUTO, SOIL_CREATE_NEW_ID, SOIL_FLAG_MIPMAPS);

I want just a standalone application without the need to bundle folders with resources that need to be in the right place. How can I include files as a resource in Visual Studio and then use the with SOIL/Fl_PNG_Image and if not what else would people normally do in such a situation?

Thanks.

user3353819
  • 911
  • 2
  • 8
  • 21
  • 1) set your subsystem to windows. It is probably set to console – cup Oct 21 '14 at 11:54
  • 2) Have you tried relative paths i.e. ./ or .\\. Not sure which one works for windows. – cup Oct 21 '14 at 11:55
  • To get rid of the console I ended up needing to replace `int main()` with `int WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,char*,int nShowCmd)`, the subsystem settings etc were fine. My point with the paths is not that I can't load from a given path, but that on Windows there is no way to bundle it with the .exe in a known (and hidden) path. Ie I have to use a resource but then the mechanimsm for loading the images/textures isn't set up for that... I was asking for a workaround – user3353819 Oct 27 '14 at 16:39

0 Answers0