SDL_GetNumVideoDrivers(3)

πŸ’– SDL_GetNumVideoDrivers(3) πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where we answer the question nobody asked but everybody needed: how many video drivers did SDL actually get compiled with? πŸŽ€


✨ NAME ✨

SDL_GetNumVideoDrivers β€” get the number of video drivers compiled into SDL, fr fr πŸ’…


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_video.h>

int SDL_GetNumVideoDrivers(void);

πŸ¦‹ DESCRIPTION πŸ¦‹

so like. SDL has video drivers. not one, not two, a whole stack of them, all baked in at compile time. this function is the vibe check that tells you how many of them exist πŸ‘‘


πŸ’œ RETURN VALUE πŸ’œ

returns the number of built in video drivers. that's it. that's the whole tea. β˜•βœ¨


πŸ”’ THREAD SAFETY πŸ”’

bestie. listen. this function should only be called on the main thread. no side quests, no background thread shenanigans, main thread only. periodt. πŸ’€

🫢 AVAILABILITY 🫢

this function is available since SDL 3.2.0. if you're on anything older, sorry babe, it's not giving 😭


πŸ‘€ SEE ALSO πŸ‘€


Simple Directmedia Layer πŸ¦‹ SDL 3.4.18 πŸŽ€ and yeah that's the whole page, mwah πŸ’‹ go call SDL_GetVideoDriver(3) next, iykyk βœ¨πŸŒˆπŸ’…

πŸ“¦ where this page comes from