Skip to main content
GameDev.net gamedev.net
🔒 Locked

IMG_ReadXPMFromArray

Started by negflar Jun 5, 2006 at 4:17 PM 1 replies 1k views
Original Post
negflar
negflar
Hello, I'm trying to load a xpm image that i have converted from a bmp image with ImageMagick. The code is:

#include "image.xpm"
SDL_Surface *image = NULL;
image = IMG_ReadXPMFromArray( image ); //in image.xpm, the array is called image[]

when i try to compile this code in visual c++, i have this error windows: Unhandled exception at 0x00385285 in prog.exe: 0xC0000005: Access violation reading location 0x000000 What's this? tank's
mattst88
mattst88
You have two variables named 'image'. Not good. I don't know if this could be causing the error, but nonetheless, you should change the names.
negflar
negflar
Oops, you have reason!
when I have rewritten the code in this post I have used image.xpm and image. In my code, the name of image is myImage.xpm and SDL_Surface is *background.
Sorry for this mistake.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.