|
al_set_display_icon() from executable |
Desmond Taylor
Member #11,943
May 2010
|
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? |
Evert
Member #794
November 2000
|
Why do you need to call al_set_display_icon() if the icon is already embedded in the executable? |
Desmond Taylor
Member #11,943
May 2010
|
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. |
Evert
Member #794
November 2000
|
Shouldn't it automatically set the icon to the one that's associated with the program? That's what I'd expect anyway. |
Desmond Taylor
Member #11,943
May 2010
|
No it doesn't And yea I'm using Windows 7 32bit. |
Elias
Member #358
May 2000
|
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. -- |
Thomas Fjellstrom
Member #476
June 2000
|
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. -- |
Desmond Taylor
Member #11,943
May 2010
|
Elias said: 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. Thomas Fjellstrom said: 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? |
Trent Gamblin
Member #261
April 2000
|
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).
|
Desmond Taylor
Member #11,943
May 2010
|
Trent Gamblin said: 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? |
Elias
Member #358
May 2000
|
A4 has this in the same line instead of NULL: wnd_class.hIcon = LoadIcon(allegro_inst, "allegro_icon");
-- |
|