Okay, I've added the icon to the executable using a resource file and don't want to also include it as a png. Is there a way I can get the icon from the executable file and use al_set_display_icon() on it?
Why do you need to call al_set_display_icon() if the icon is already embedded in the executable?
To set the window icon I want my game to run in both fullscreen and windoed mode and in windowed I need the icon to be attached to the window.
Shouldn't it automatically set the icon to the one that's associated with the program? That's what I'd expect anyway.
I guess you're using Windows though, and I have no idea how this works there...
No it doesn't And yea I'm using Windows 7 32bit.
The problem is likely this line: http://allefant.com/gtags/S/2046.html#L868
If someone knows how to instead set the .exe icon there that would be nice of course. For now it should be easy enough providing the icon as a .png file and setting with al_set_display_icon though.
A4 has a mechanism that let you include an "allegro_icon" resource that it would load and set for the window initially. We should probably do something similar for A5.
For now it should be easy enough providing the icon as a .png file and setting with al_set_display_icon though.
I really want to try and avoid that.
A4 has a mechanism that let you include an "allegro_icon" resource that it would load and set for the window initially. We should probably do something similar.
Did that use the icon from the executable?
The allegro_icon thing is the executable icon. Windows has two different icons you want to set. The first one is the executable icon that will show in Explorer. The window titlebar icon is set with al_set_display_icon.
Edit: If you don't want to include a png file you could use the memfile addon to load a png from a binary dump (into a header file).
If you don't want to include a png file you could use the memfile addon to load a png from a binary dump (into a header file).
I really have no idea where to start with that. Any chance you can give me an example?
A4 has this in the same line instead of NULL:
wnd_class.hIcon = LoadIcon(allegro_inst, "allegro_icon");