SDL_PLATFORM_WINDOWS(3)

πŸ’– SDL_PLATFORM_WINDOWS πŸ’–

okay bestie, welcome to the SDL_PLATFORM_WINDOWS page from the SDL3 functions crew, we're gonna get you fluent in this macro in like thirty seconds, no cap 🫢


✨ NAME ✨

SDL_PLATFORM_WINDOWS β€” it's a preprocessor macro, and the way it works is so simple: it only exists (only gets defined, periodt) if you're compiling for Windows. that's it. that's the whole vibe check πŸ’…


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_platform_defines.h>

#define SDL_PLATFORM_WINDOWS 1

look at her. iconic. she's just sitting there in the header file waiting for you to #ifdef her 😌


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea: this macro isn't just for "Windows" Windows, okay? she's a big umbrella energy kind of girl. she also covers several other platforms, like Microsoft GDK, Xbox, WinRT, etc. 🌈

and listen β€” each of those will have their own more-specific platform macros too, so if you need to get granular, the specific ones are right there. SDL_PLATFORM_WINDOWS is the "yes we're in the Windows family" check, not the "which exact flavor of Windows family" check. iykyk ✨


πŸŽ€ AVAILABILITY πŸŽ€

this macro is available since SDL 3.2.0. so if you're on something older, sorry babe, she's not there yet 😭


πŸ’œ SEE ALSO πŸ’œ

go read these next, bestie, they're her siblings and they're all serving:


🌟 friendly reminder: this is a preprocessor macro, so it does its thing at compile time, not at runtime. vibe check your build target before you ship, fr fr πŸ’€

Simple Directmedia Layer came through with this one, and this page is from SDL 3.4.18 β€” yeah, she's got the SDL_PLATFORM_WINDOWS(3) energy through and through. mwah, go compile something cute πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from