SDL_HINT_WINDOWS_ERASE_BACKGROUND_MODE(3)

πŸ’– SDL_HINT_WINDOWS_ERASE_BACKGROUND_MODE(3) πŸ’–

okay bestie, pull up a chair, because we're talking about the manual page for SDL_HINT_WINDOWS_ERASE_BACKGROUND_MODE(3) and honestly? it's giving subtle but powerful. πŸ¦‹


✨ NAME ✨

SDL_HINT_WINDOWS_ERASE_BACKGROUND_MODE β€” a variable that controls whether SDL clears the window contents when it gets the WM_ERASEBKGND message. that's the whole vibe. πŸŽ€


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_hints.h>

#define SDL_HINT_WINDOWS_ERASE_BACKGROUND_MODE "SDL_WINDOWS_ERASE_BACKGROUND_MODE"

yeah, that's the include and that's the string name. copy it exactly, no improvising, no cap. πŸ’…


🫢 DESCRIPTION 🫢

so the variable can be set to these values, and you have options, main character:

  • "0" / "never" β€” never clear the window. like, ever. it said what it said. πŸ™ˆ
  • "1" / "initial" β€” clear the window when the first WM_ERASEBKGND event fires. this is the default ⭐
  • "2" / "always" β€” clear the window on every single WM_ERASEBKGND event. every one. no skips. πŸ”₯
lowkey important: this hint should be set before creating a window. set it after and it's not gonna hit the same, fr fr. 😭

🌈 AVAILABILITY 🌈

this hint has been available since SDL 3.2.0. iconic behavior, honestly. πŸ‘‘


and that's the page, bestie!! written by Simple Directmedia Layer, running on SDL 3.4.18, straight from the SDL_HINT_WINDOWS_ERASE_BACKGROUND_MODE(3) manual. go forth and erase those backgrounds (or don't, it's literally a setting) πŸ§šπŸ’œβœ¨

πŸ“¦ where this page comes from