The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
[O.T.]-Linux Makefile Building In Terminal-App Icon?
JeZ-l-Lee


Joined: 20 Sep 2009
Posts: 572
Location: Long Island, New York, United States, Earth
[O.T.]-Linux Makefile Building In Terminal-App Icon?

Hi,

We are working on completing the SDL1 to SDL2 port of our "PacDude Hero 100%" game now.

We have the following question for Linux programming experts:
When building an SDL2 video game from source on Linux,
how do we specify the application icon when using a makefile?
(the icon shown in panel and game's window icon)

Thanks in advance!

Here is the current makefile:
Code:
# "PacDude Hero 100%[TM]" - MAKEFILE by JeZ+Lee & mattmatteh...
# (C)opyright 2015 By www.16BitSoft.com

TARGET = pdh

VERSION = 3.5

DEL_FILE = rm -f

CC      = g++
CFLAGS = -pipe -Wall -g #-"ggdb"
SDL_CFLAGS = $(shell sdl2-config --cflags)
SDL_LIBS = $(shell sdl2-config --libs)

SDL_TTF_LIBS   = -lSDL2_ttf
SDL_IMAGE_LIBS   = -lSDL2_image
SDL_MIXER_LIBS  = -lSDL2_mixer

OBJECTS = src/main.o \
          src/audio.o \
          src/data.o \
          src/input.o \
          src/interface.o \
          src/logic.o \
          src/screens.o \
          src/visuals.o

SOURCES = src/main.cpp \
          src/audio.cpp \
          src/data.cpp \
          src/input.cpp \
          src/interface.cpp \
          src/logic.cpp \
          src/screens.cpp \
          src/visuals.cpp

HEADERS = src/audio.h \
          src/data.h \
          src/input.h \
          src/interface.h \
          src/logic.h \
          src/screens.h \
          src/visuals.h

$(TARGET): $(OBJECTS)
   $(CC) $(OBJECTS) $(SDL_LIBS) $(SDL_TTF_LIBS) $(SDL_IMAGE_LIBS) $(SDL_MIXER_LIBS) -o $@

.cpp.o:
   $(CC) $(CFLAGS) $(SDL_CFLAGS) -c $< -o $@

clean:
   rm $(OBJECTS) $(TARGET)
[O.T.]-Linux Makefile Building In Terminal-App Icon?
Ryan C. Gordon
Guest

Icons in Linux aren't embedded in the binary like they are in windows .exe files. You should use a .desktop file when installing the app on Linux, which tells the desktop environment various details (name, icon, genre, etc).


http://standards.freedesktop.org/desktop-entry-spec/latest/


--ryan.



On Jun 14, 2015, at 1:20 PM, JeZ-l-Lee wrote:


Quote:
[O.T.]-Linux Makefile Building In Terminal-App Icon?

Hi,

We are working on completing the SDL1 to SDL2 port of our "PacDude Hero 100%" game now.

We have the following question for Linux programming experts:
When building an SDL2 video game from source on Linux,
how do we specify the application icon when using a makefile?
(the icon shown in panel and game's window icon)

Thanks in advance!

Here is the current makefile:







Code: # "PacDude Hero 100%[TM]" - MAKEFILE by JeZ+Lee & mattmatteh...
# (C)opyright 2015 By www.16BitSoft.com

TARGET = pdh

VERSION = 3.5

DEL_FILE = rm -f

CC = g++
CFLAGS = -pipe -Wall -g #-"ggdb"
SDL_CFLAGS = $(shell sdl2-config --cflags)
SDL_LIBS = $(shell sdl2-config --libs)

SDL_TTF_LIBS = -lSDL2_ttf
SDL_IMAGE_LIBS = -lSDL2_image
SDL_MIXER_LIBS = -lSDL2_mixer

OBJECTS = src/main.o \
src/audio.o \
src/data.o \
src/input.o \
src/interface.o \
src/logic.o \
src/screens.o \
src/visuals.o

SOURCES = src/main.cpp \
src/audio.cpp \
src/data.cpp \
src/input.cpp \
src/interface.cpp \
src/logic.cpp \
src/screens.cpp \
src/visuals.cpp

HEADERS = src/audio.h \
src/data.h \
src/input.h \
src/interface.h \
src/logic.h \
src/screens.h \
src/visuals.h

$(TARGET): $(OBJECTS)
$(CC) $(OBJECTS) $(SDL_LIBS) $(SDL_TTF_LIBS) $(SDL_IMAGE_LIBS) $(SDL_MIXER_LIBS) -o $@

.cpp.o:
$(CC) $(CFLAGS) $(SDL_CFLAGS) -c $< -o $@

clean:
rm $(OBJECTS) $(TARGET)




JeZxLee
JessePalser <AT> GMail <DOT> com
16BitSoft Inc.
Video Game Design Studio
www.16BitSoft.com

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

[O.T.]-Linux Makefile Building In Terminal-App Icon?
Daniel Gibson
Guest

Well, that's true for the desktop/menu shortcuts, but the window-icon
can be integrated into the executable, see
https://caedesnotes.wordpress.com/2015/04/13/how-to-integrate-your-sdl2-window-icon-or-any-image-into-your-executable/

Cheers,
Daniel

On 06/14/2015 08:45 PM, Ryan C. Gordon wrote:
Quote:

Icons in Linux aren't embedded in the binary like they are in windows
.exe files. You should use a .desktop file when installing the app on
Linux, which tells the desktop environment various details (name, icon,
genre, etc).

http://standards.freedesktop.org/desktop-entry-spec/latest/

--ryan.


On Jun 14, 2015, at 1:20 PM, JeZ-l-Lee

<mailto:> wrote:

Quote:
[O.T.]-Linux Makefile Building In Terminal-App Icon?

Hi,

We are working on completing the SDL1 to SDL2 port of our "PacDude
Hero 100%" game now.

We have the following question for Linux programming experts:
When building an SDL2 video game from source on Linux,
how do we specify the application icon when using a makefile?
(the icon shown in panel and game's window icon)

Thanks in advance!

Here is the current makefile:







Code:
# "PacDude Hero 100%[TM]" - MAKEFILE by JeZ+Lee & mattmatteh...
# (C)opyright 2015 By www.16BitSoft.com <http://www.16BitSoft.com>

TARGET = pdh

VERSION = 3.5

DEL_FILE = rm -f

CC = g++
CFLAGS = -pipe -Wall -g #-"ggdb"
SDL_CFLAGS = $(shell sdl2-config --cflags)
SDL_LIBS = $(shell sdl2-config --libs)

SDL_TTF_LIBS = -lSDL2_ttf
SDL_IMAGE_LIBS = -lSDL2_image
SDL_MIXER_LIBS = -lSDL2_mixer

OBJECTS = src/main.o \
src/audio.o \
src/data.o \
src/input.o \
src/interface.o \
src/logic.o \
src/screens.o \
src/visuals.o

SOURCES = src/main.cpp \
src/audio.cpp \
src/data.cpp \
src/input.cpp \
src/interface.cpp \
src/logic.cpp \
src/screens.cpp \
src/visuals.cpp

HEADERS = src/audio.h \
src/data.h \
src/input.h \
src/interface.h \
src/logic.h \
src/screens.h \
src/visuals.h

$(TARGET): $(OBJECTS)
$(CC) $(OBJECTS) $(SDL_LIBS) $(SDL_TTF_LIBS) $(SDL_IMAGE_LIBS)
$(SDL_MIXER_LIBS) -o $@

.cpp.o:
$(CC) $(CFLAGS) $(SDL_CFLAGS) -c $< -o $@

clean:
rm $(OBJECTS) $(TARGET)



------------------------------------------------------------------------

JeZxLee
JessePalser <AT> GMail <DOT> com
16BitSoft Inc.
Video Game Design Studio
www.16BitSoft.com <http://www.16BitSoft.com>
_______________________________________________
SDL mailing list
<mailto:
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
[O.T.]-Linux Makefile Building In Terminal-App Icon?
Ryan C. Gordon
Guest

On 06/14/2015 02:50 PM, Daniel Gibson wrote:
Quote:
Well, that's true for the desktop/menu shortcuts, but the window-icon
can be integrated into the executable, see
https://caedesnotes.wordpress.com/2015/04/13/how-to-integrate-your-sdl2-window-icon-or-any-image-into-your-executable/

Well, yes, you can store static data that is used at runtime, but he was
asking how to get the OS to show the game icon on the Desktop, etc.

--ryan.


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
[O.T.]-Linux Makefile Building In Terminal-App Icon?
Daniel Gibson
Guest

On 06/16/2015 09:34 AM, Ryan C. Gordon wrote:
Quote:
On 06/14/2015 02:50 PM, Daniel Gibson wrote:
Quote:
Well, that's true for the desktop/menu shortcuts, but the window-icon
can be integrated into the executable, see
https://caedesnotes.wordpress.com/2015/04/13/how-to-integrate-your-sdl2-window-icon-or-any-image-into-your-executable/


Well, yes, you can store static data that is used at runtime, but he was
asking how to get the OS to show the game icon on the Desktop, etc.

--ryan.


As far as I understood he asked for both both ("and game's window icon").
As he didn't give any further feedback I guess that the combination of
our replies either answered his question completely or confused him so
much that he doesn't want to ask any further.

(I find it rude to ask questions and then not reacting to the replies..
either by saying "Thank you, this explains/fixes it" or by stating
what's still unclear.)

Cheers,
Daniel
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
[O.T.]-Linux Makefile Building In Terminal-App Icon?
JeZ-l-Lee


Joined: 20 Sep 2009
Posts: 572
Location: Long Island, New York, United States, Earth
Hi,

Sorry, thanks!
Released the game here:
https://forums.libsdl.org/viewtopic.php?t=11299


Jesse "JeZxLee"



On 06/16/2015 08:44 AM, Daniel Gibson wrote:
Quote:
On 06/16/2015 09:34 AM, Ryan C. Gordon wrote:
Quote:
On 06/14/2015 02:50 PM, Daniel Gibson wrote:
Quote:
Well, that's true for the desktop/menu shortcuts, but the window-icon
can be integrated into the executable, see
https://caedesnotes.wordpress.com/2015/04/13/how-to-integrate-your-sdl2-window-icon-or-any-image-into-your-executable/



Well, yes, you can store static data that is used at runtime, but he was
asking how to get the OS to show the game icon on the Desktop, etc.

--ryan.


As far as I understood he asked for both both ("and game's window icon").
As he didn't give any further feedback I guess that the combination of
our replies either answered his question completely or confused him so
much that he doesn't want to ask any further.

(I find it rude to ask questions and then not reacting to the
replies.. either by saying "Thank you, this explains/fixes it" or by
stating what's still unclear.)

Cheers,
Daniel
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org