Well, for the first time in the roughly 10 years the ENIGMA game engine has been around, you can now natively set a PNG icon for your game that will show in the title bar, task manager, system monitor, and Alt+Tab process swapper. No thanks to those fat lards Josh, Robert, and fundies. No offense, I love you guys, but I couldn't take it any longer so I decided to step in and add Linux icon support.
Includes the following functions:
string window_get_icon() returns the absolute path to the custom icon being used by the game. Returns an empty string "" if there is not one currently used.
void window_set_icon(string fname) sets the icon to use for the game from the given PNG filename fname.
void window_set_icon_from_unpacked_sprite(int ind, unsigned subimg, string fname) Want to export your game as a single executable? You can! Exports the internal sprite resource of the given sprite index ind and subimage subimg. Export it to preferably the temp_directory or game_save_id folders with the provided PNG filename fname. The image will be loaded from that exported location and will be displayed as the icon.
void window_set_icon_from_unpacked_background(int ind, string fname) Similar to the sprite function. Exports the internal backgound resource of the given background index ind. Export it to preferably the temp_directory or game_save_id folders with the provided PNG filename fname. The image will be loaded from that exported location and will be displayed as the icon.
Example project and 64-bit demo executable: animated_icon.zip
As a small side note - this pull request also allows capturing SDL's window handle on linux for widget use. Although I still haven't fixed the SDL bug where the game doesn't respond and then segfaults, if you click the close button in the main game window's title bar over and over while a dialog is open. Not many people will do that so it's not a huge bug.
@@ Coverage Diff @@ ## master #1854 +/- ## ========================================== - Coverage 25.15% 25.03% -0.12% ========================================== Files 177 178 +1 Lines 16844 16927 +83 ========================================== + Hits 4237 4238 +1 - Misses 12607 12689 +82
|Impacted Files||Coverage Δ|
@JoshDreamland please review kthx