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 🫢


source/version sign-off: SDL_image, version 3.4.4 β€” mwah πŸ’–

πŸ“¦ where this page comes from