[SDL] App icon sometimes not appearing on window titlebar

Ronald Lamprecht R.Lamprecht at T-Online.de
Sun Mar 30 11:26:06 PDT 2008


Hi,

Stephen Anthony wrote:
> On March 30, 2008 3:10:17 pm Ken Rogoway wrote:
>> I ran into something similar.  You need to make sure you call
>> SDL_WM_SetIcon() before you call SDL_SetVideoMode().
> 
> But would that cause it to work sometimes, and not other times?  Also, 
> is there any harm in calling the method more than once per application 
> invocation (basically, if you destroy and recreate the window, it is OK 
> to call the function again)?

I did run into the same problems on the "Enigma" project 
(http://www.nongnu.org/enigma). Every OS had need of another SDL 
handling and even the different Windows versions did prove to be 
incompatible (XP is an exception, 95,98, 2000, Vista are the same)

You will find the handling for Linux, all Windows, Mac OS X in the file:

http://svn.berlios.de/wsvn/enigma-game/trunk/src/video.cc

(Sorry this file would need some cleanup)

The main comment I added last year to the sources:

// Set the caption icon -- due to SDL doc it has to be set before first 
SDL_SetVideoMode() !!
// In praxis this SetIcon does not work for Linux, nor is it necessary 
for OSX.
// Just XP with selected "WindowsXP Design" needs this SetIcon.
// See video::Init() for icon set for Linux and other Windows versions
// Mac icon is set via Makefile


I would really appreciate a simple unified SDL handling of this problem.

Greets,

Ronald


More information about the SDL mailing list