Setting the icon from a resource

Hello!

I’m currently porting my game to windows and I’m having trouble setting
the icon in the titlebar.

Does anyone have a codesample on how to set it using a resource file?

– Miffe

With:

SDL_WM_SetCaption(“Title window”,NULL);

you set the title window and with

SDL_WM_SetIcon(surface,NULL);

you set the icon.

cheers> ----- Original Message -----

From: miffe-miffe@telia.com (Mikael Eriksson)
To:
Sent: Wednesday, March 16, 2005 7:17 AM
Subject: [SDL] Setting the icon from a resource

Hello!

I’m currently porting my game to windows and I’m having trouble setting
the icon in the titlebar.

Does anyone have a codesample on how to set it using a resource file?

– Miffe


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Roberto Prieto wrote:

With:

SDL_WM_SetCaption(“Title window”,NULL);
you set the title window and with

SDL_WM_SetIcon(surface,NULL);

I know, but how do I get the icon from the windows resource file to a
surface?>

you set the icon.

cheers

----- Original Message ----- From: "Mikael Eriksson"

To:
Sent: Wednesday, March 16, 2005 7:17 AM
Subject: [SDL] Setting the icon from a resource

Hello!

I’m currently porting my game to windows and I’m having trouble setting
the icon in the titlebar.

Does anyone have a codesample on how to set it using a resource file?

– Miffe


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Hello!

I’m currently porting my game to windows and I’m having trouble setting
the icon in the titlebar.

Does anyone have a codesample on how to set it using a resource file?

You can either choose to find an alternative to using a “resource” at
all, or ask your question on a relevant mailing list. It’s true, you
might get a “codesample” from someone on this list because perhaps
they’d wanted to do what you’re doing, but this really is an MSVS
question.

You’ll probably want to reconsider why you’re using such MS specific
features anyhow. It will be a pain in the ass for anyone to build your
software on a platform besides windows if you make a habit of letting
MS do your work for you.On Mar 16, 2005, at 1:17 AM, Mikael Eriksson wrote:

Donny Viszneki wrote:

Hello!

I’m currently porting my game to windows and I’m having trouble setting
the icon in the titlebar.

Does anyone have a codesample on how to set it using a resource file?

You can either choose to find an alternative to using a “resource” at
all, or ask your question on a relevant mailing list. It’s true, you
might get a “codesample” from someone on this list because perhaps
they’d wanted to do what you’re doing, but this really is an MSVS question.

Why do you presume that I use MSVS. I use MinGW + msys.

You’ll probably want to reconsider why you’re using such MS specific
features anyhow. It will be a pain in the ass for anyone to build your
software on a platform besides windows if you make a habit of letting MS
do your work for you.

I simply wanting to do it in this way because the icon resource is
allready in the exe, otherwise the exe file wouldn’t have a icon. And so
that i don’t have do distribute a separate bmp with my program.> On Mar 16, 2005, at 1:17 AM, Mikael Eriksson wrote:

I simply wanting to do it in this way because the icon resource is
allready in the exe, otherwise the exe file wouldn’t have a icon. And so
that i don’t have do distribute a separate bmp with my program.

There are portable ways to achieve this. For example you could use the XPM
format, which can actually be included into your program by means of
#include.
There are also free libraries etc. avaliable for parsing the format.

For example take a look at http://koala.ilog.fr/lehors/xpm.html

Best regards,

/Persson, K.