[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.2.18 IMG_ReadXPMFromArray

SDL_Surface *IMG_ReadXPMFromArray(char **xpm)

xpm
The source xpm data. The XPM image is loaded from this. XPM files are C header files that define a char **variable, that variable name is what you use here.

Load xpm as a XPM image for use as a surface, if XPM support is compiled into the SDL_image library.

Returns: a pointer to the image as a new SDL_Surface. NULL is returned on errors, like if XPM is not supported, or a read error.

 
// load sample.xpm into image
#include "sample.xpm"
SDL_Surface *image;
image=IMG_ReadXPMFromArray(sample_xpm);
if(!image) {
    printf("IMG_ReadXPMFromArray: %s\n", IMG_GetError());
    // handle error
}

See Also:
3.2.8 IMG_LoadXPM_RW



This document was generated on November, 3 2009 using texi2html