Little top corner icon in Windows

48 views
Skip to first unread message

in...@retro64.com

unread,
May 7, 2012, 9:56:23 AM5/7/12
to haxe...@googlegroups.com

Hi Guys:

Has anyone successfully changed the little icon in the top left corner of a window in haxe/nme for the Windows target?  I can change all the other icons, like the one in the task bar, but this one is stubborn! 

Thanks!



corner_icon.jpg

in...@retro64.com

unread,
May 7, 2012, 11:29:30 AM5/7/12
to haxe...@googlegroups.com
Looks like Lib.setIcon() works, but the icon has to be a windows bmp...

Mihail Ivanchev

unread,
May 7, 2012, 11:35:44 AM5/7/12
to haxe...@googlegroups.com
Yes the reason for this is that NME delegates the call to SDL via SDL_LoadBMP. Here is the code:

void SetIcon( const char *path ) {
   initSDL();

   SDL_Surface *surf = SDL_LoadBMP(path);

   if ( surf != NULL )
      SDL_WM_SetIcon( surf, NULL);

}
it could be easily fixed to support other formats as well, as SDL_WM_SetIcon expects just a bitmask and doesn't care about formats.

Reply all
Reply to author
Forward
0 new messages