SDL_GetDXGIOutputInfo(3)

๐Ÿ’– SDL_GetDXGIOutputInfo ๐Ÿ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the man pages โ€” this one is SDL_GetDXGIOutputInfo(3) and it's lowkey niche but highkey useful if you're doing Windows graphics stuff. Windows only vibes, iykyk. ๐ŸชŸโœจ


๐ŸŒธ NAME ๐ŸŒธ

SDL_GetDXGIOutputInfo โ€” grab the DXGI Adapter and Output indices for the display you're pointing at. that's the whole job. slay.


๐ŸŽ€ SYNOPSIS ๐ŸŽ€

#include <SDL3/SDL_system.h>

bool SDL_GetDXGIOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex);

like. three args. one bool. we love a clean signature. ๐Ÿ’…


๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so here's the tea: once you have those DXGI Adapter and Output indices, you can pass them to EnumAdapters and EnumOutputs respectively โ€” and that's how you get the objects you need to create a DX10 or DX11 device and swap chain. ๐ŸŽฎ

basically it's the little bridge between SDL knowing about your display and DirectX knowing about your display. not me being the middleman of the graphics pipeline fr fr. ๐Ÿ˜ญ


โœจ FUNCTION PARAMETERS โœจ

  • displayID โ€” the instance of the display you wanna query. which screen, bestie. ๐Ÿ‘€
  • adapterIndex โ€” a pointer that gets filled in with the adapter index. it's giving "you hand me a pointer, I hand you the answer." ๐Ÿซถ
  • outputIndex โ€” a pointer that gets filled in with the output index. same deal, different number. ๐ŸŽ€

๐ŸŒˆ RETURN VALUE ๐ŸŒˆ

returns true on success or false on failure. and if it fails? call SDL_GetError() for more information โ€” she will tell you what went wrong, no cap. ๐Ÿ“ข


๐Ÿ‘‘ AVAILABILITY ๐Ÿ‘‘

this function is available since SDL 3.2.0. so if you're on something older... girl. upgrade. ๐Ÿ’€


๐Ÿ’ก quick reminder: every single one of these details matters โ€” the pointer types, the true/false, the SDL_GetError() call โ€” so don't get cute and skip them, mwah. ๐Ÿ’‹

sign-off time ๐ŸŽ€โœจ this page came to you from Simple Directmedia Layer, version SDL 3.4.18, dated with the very same <rainbow>SDL_GetDXGIOutputInfo(3)</rainbow> energy it started with. stan the man pages, bestie, they love you. ๐Ÿ’œ๐Ÿฆ‹๐Ÿ’…

๐Ÿ“ฆ where this page comes from