SDL_HINT_BMP...LEGACY_FORMAT(3)

πŸ’… SDL_HINT_BMP_SAVE_LEGACY_FORMAT πŸ’…

okay bestie, welcome to the SDL3 FUNCTIONS section of the manual, and today's main character is SDL_HINT_BMP_SAVE_LEGACY_FORMAT β€” she's here to stop SDL from pulling out version 4 of the bitmap header when it's saving your BMPs. no cap.


✨ NAME ✨

SDL_HINT_BMP_SAVE_LEGACY_FORMAT β€” prevent SDL from using version 4 of the bitmap header when saving BMPs. literally that's her whole job and she ate πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3/SDL_hints.h>

#define SDL_HINT_BMP_SAVE_LEGACY_FORMAT "SDL_BMP_SAVE_LEGACY_FORMAT"

like, that's the include and that's the define, copy them exactly, no editing your faves 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea β˜•: the bitmap header version 4 is required for proper alpha channel support, and SDL will use it when it's required. that's just facts.

but should this not be desired β€” like, if you're out here not wanting that β€” this hint can force the use of the 40 byte header version which is supported everywhere. universal icon behaviour honestly πŸ‘‘

the variable can be set to the following values:

  • "0" β€” surfaces with a colorkey or an alpha channel are saved to a 32-bit BMP file with an alpha mask. SDL will use the bitmap header version 4 and set the alpha mask accordingly. this is the default, bestie, she's the baseline ✨
  • "1" β€” surfaces with a colorkey or an alpha channel are saved to a 32-bit BMP file without an alpha mask. the alpha channel data will be in the file, but applications are going to ignore it. like... the data is there, it's just getting ghosted πŸ’€
this hint can be set anytime. no timing drama, no scheduling trauma, she's flexible πŸ’…

🌈 AVAILABILITY 🌈

this hint is available since SDL 3.2.0. so if you're on something older... girl. upgrade. πŸ™ˆ


that's the whole vibe, bestie β€” go forth and save your BMPs however you like πŸ’œ

Simple Directmedia Layer Β· SDL 3.4.18 β€” mwah, love you, bye πŸŽ€πŸ’–βœ¨

πŸ“¦ where this page comes from