Pages: 1
Author Topic: Native Linux Icon Support  (Read 928 times)
Offline (Male) time-killer-games
Posted on: September 03, 2019, 09:08:31 AM

Location: Virginia Beach
Joined: Jan 2013
Posts: 1157

View Profile Email
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:

    - window_get_icon_index() returns the sprite index of the current icon

    - window_get_icon_subimg() returns the sprite subimg of the current icon

    - void window_set_icon(ind, subimg) sets the icon to use for the game from the given sprite resource

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.

The pull request this text was copied from can be viewed here, along with the actual code changes and additions:

For early access to this update, follow these set of instructions listed below:

1) download and extract this ZIP archive to the folder of your choosing:
(This dropbox link won't be available anymore after being merged into master officially)

2) Install these dependencies if you haven't already, (copied from the wiki):

Ubuntu/Debian-based distro's:
Code: [Select]
sudo add-apt-repository ppa:maarten-fonville/protobuf
sudo apt-get update
sudo apt-get install g++ libprotobuf-dev protobuf-compiler zlib1g-dev libglew-dev libglm-dev libpng-dev libglu1-mesa-dev libalure-dev libvorbisfile3 libvorbis-dev libbox2d-dev libdumb1-dev libepoxy-dev git default-jre default-jdk make pkg-config wget
Since you aren't installing this the normal way, some of those dependencies and tools are redundant in this case, but that's aside the point of this topic.  :smileycat:

Manjaro/Arch-based Linux (some dependencies are missing on the wiki I got this from - find out the rest on your own; I don't use Arch Linux):
Code: [Select]
sudo pacman -Sy git make gcc zlib glew glm glu mesa alure box2d dumb zenity openal patch wget fakeroot cmake pkgconfig
pacman -S jdk8-openjdk

3) Terminal this:
Code: [Select]
cd /path/to/extracted/enigma-dev
4) Terminal that:
Code: [Select]

5) Run LateralGM:
Code: [Select]
java -jar lateralgm.jar
...or install emake as instruncted from the wiki and use that as you would normally.

Please note the aforementioned linux extension has not been written yet. All it will be really is an optional Makefile adding the compiler/linker flags for statically linking the extra dependencies.

Happy coding!
« Last Edit: October 25, 2019, 03:37:36 PM by time-killer-games » Logged
Pages: 1