SDL_WM_SetIcon, Unable to load a BMP image or a surface

All -

I call SDL_WM_SetIcon before my call to SDL_SetVideoMode. I check to make
sure that the BMP is loaded, image = SDL_LoadBMP(“image.bmp”); if (image ==
NULL). I then make the call to SDL_WM_SetIcon, SDL_WM_SetIcon(image, NULL).
My program receives a segmetation fault. I am testing my code under both
WIN32 and Linux with a 32x32 bmp image of 24-bits. The SDL version that I
have installed is 1.2. Any ideas as to why my image is not accepted by
SDL_WM_SetIcon? Is there a problem with the way I am creating/saving the BMP
image? Thank you for any help.–

  • Vincent Williams

If you can say it, you can code it.

Can you post the rest of the code where you set the icon? I’m curious as to
what happens after the ‘if (image == null)’ part…–
View this message in context: http://www.nabble.com/SDL_WM_SetIcon%2C-Unable-to-load-a-BMP-image-or-a-surface-tp23122017p23122169.html
Sent from the SDL mailing list archive at Nabble.com.

Jesse -

I hate to say this, but I made a beginner mistake and called this function
before I called SDL_Init(). I have now placed my code in the correct
position and the icon does load and is shown. Please forgive me.

  • Vincent Williams

Jesse A. wrote:>

Can you post the rest of the code where you set the icon? I’m curious as
to what happens after the ‘if (image == null)’ part…


View this message in context: http://www.nabble.com/SDL_WM_SetIcon%2C-Unable-to-load-a-BMP-image-or-a-surface-tp23122017p23122197.html
Sent from the SDL mailing list archive at Nabble.com.