SDL_GetDirect3D9AdapterIndex(3)

πŸ’– SDL_GetDirect3D9AdapterIndex πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, this one's called SDL_GetDirect3D9AdapterIndex and it is literally your plug for matching a display to its D3D9 adapter index πŸ¦‹


✨ NAME ✨

SDL_GetDirect3D9AdapterIndex β€” get the D3D9 adapter index that matches the specified display πŸ’…


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_system.h>

int SDL_GetDirect3D9AdapterIndex(SDL_DisplayID displayID);

πŸŽ€ DESCRIPTION πŸŽ€

so here's the tea πŸ“ the adapter index you get back can be passed straight into IDirect3D9::CreateDevice, and that's the thing that controls on which monitor a full screen application will appear. yes, the whole "which screen am I taking over" situation. that's the vibe. no cap πŸ”₯


πŸ’œ FUNCTION PARAMETERS πŸ’œ

  • displayID β€” the instance of the display to query. like, which one are we talking about bestie, be specific 🫢

⭐ RETURN VALUE ⭐

Returns the D3D9 adapter index on success, or -1 on failure 😭 and if you got the -1, go call SDL_GetError() for more information, she'll tell you what went wrong.

not the -1 bestie, that's the "something's off" signal fr fr

🌈 AVAILABILITY 🌈

this function is available since SDL 3.2.0. it's not ancient, it's just iconic πŸ‘‘


that's the whole page, go forth and create your device ✨

Simple Directmedia Layer β€” SDL 3.4.18 β€” SDL_GetDirect3D9AdapterIndex(3) πŸ’– mwah, stay slaying, read the docs, hydrate πŸŒΈπŸ’…

πŸ“¦ where this page comes from