Problem with SDL_image on Windows

I have only been using SDL with SDL_image on Mac OS X until now. Now I am trying on Windows.

The following code works perfectly on Mac OS X, but gives a Segmentation Fault on Windows:

SDL_Surface* bigdigitimage;
SDL_Surface* pickupsimage;
SDL_Surface* temp;
IMG_Init(IMG_INIT_PNG);
temp = IMG_Load("bigdigits.png");
bigdigitimage = SDL_DisplayFormatAlpha(temp);
SDL_FreeSurface(temp);
temp = IMG_Load("pickups.png");
IMG_Quit();
pickupsimage = SDL_DisplayFormatAlpha(temp);
SDL_FreeSurface(temp);

I have been debugging the code for a while, and found out that the problem happens at the call to SDL_DisplayFormatAlpha().

I am quite new to SDL, started using it last year for the first time, so I don’t know much of what’s happening.

Never mind, sorry…
Fixed everything alreadyOn July 26, 2010, at 22:48:54.00, Kikolani wrote:

I have only been using SDL with SDL_image on Mac OS X until now. Now I am trying on Windows.

The following code works perfectly on Mac OS X, but gives a Segmentation Fault on Windows:

SDL_Surface* bigdigitimage;
SDL_Surface* pickupsimage;
SDL_Surface* temp;
IMG_Init(IMG_INIT_PNG);
temp = IMG_Load(“bigdigits.png”);
bigdigitimage = SDL_DisplayFormatAlpha(temp);
SDL_FreeSurface(temp);
temp = IMG_Load(“pickups.png”);
IMG_Quit();
pickupsimage = SDL_DisplayFormatAlpha(temp);
SDL_FreeSurface(temp);

I have been debugging the code for a while, and found out that the problem happens at the call to SDL_DisplayFormatAlpha().

I am quite new to SDL, started using it last year for the first time, so I don’t know much of what’s happening.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Explain for posterity?

Jonny DOn Mon, Jul 26, 2010 at 3:55 PM, Kikolani wrote:

Never mind, sorry…
Fixed everything already

On July 26, 2010, at 22:48:54.00, Kikolani wrote:

I have only been using SDL with SDL_image on Mac OS X until now. Now I am
trying on Windows.

The following code works perfectly on Mac OS X, but gives a Segmentation
Fault on Windows:

SDL_Surface* bigdigitimage;
SDL_Surface* pickupsimage;
SDL_Surface* temp;
IMG_Init(IMG_INIT_PNG);
temp = IMG_Load(“bigdigits.png”);
bigdigitimage = SDL_DisplayFormatAlpha(temp);
SDL_FreeSurface(temp);
temp = IMG_Load(“pickups.png”);
IMG_Quit();
pickupsimage = SDL_DisplayFormatAlpha(temp);
SDL_FreeSurface(temp);

I have been debugging the code for a while, and found out that the problem
happens at the call to SDL_DisplayFormatAlpha().

I am quite new to SDL, started using it last year for the first time, so I
don’t know much of what’s happening.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org