IMG_ReadXPMFromArray(3)
π IMG_ReadXPMFromArray(3) π
okay so bestie, we are in the SDL_image3 FUNCTIONS manual, and the main character today is IMG_ReadXPMFromArray. she loads an XPM image from a memory array. periodt β¨
πΈ NAME πΈ
IMG_ReadXPMFromArray β load an XPM image from a memory array. that's the whole name, no cap π
π¦ SYNOPSIS π¦
#include <SDL3_image/SDL_image.h>
SDL_Surface * IMG_ReadXPMFromArray(char **xpm);
π DESCRIPTION π
The returned surface will be an 8bpp indexed surface, if possible; otherwise it will be 32bpp. if you always want 32-bit data, use IMG_ReadXPMFromArrayToRGB888() instead β she's literally right there for that exact vibe π.
When you're done with the returned surface, the app should dispose of it with a call to SDL_DestroySurface(). do not just leave it hanging around, bestie β clean up your surfaces π§.
π§ FUNCTION PARAMETERS π§
xpmβ a null-terminated array of strings that comprise XPM data. that's the whole parameter, iconic π
β RETURN VALUE β
Returns a new SDL surface, or NULL on error. yup, on error you get NULL, no cap π.
π AVAILABILITY π
This function is available since SDL_image 3.0.0. so yes, she's been available since then π .
π«Ά SEE ALSO π«Ά
IMG_ReadXPMFromArrayToRGB888(3)β the RGB888 option, iykyk β¨
source/version sign-off: SDL_image, version 3.4.4 β mwah π
π¦ where this page comes from
- ubuntu stonking: libsdl3-image-doc 3.4.4+ds-2 Β· zlib/libpng AND HPND-like AND zlib-like-permissive
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms