SDL_VideoInfo(3)

๐Ÿ“ฆ version 1.2.15, in debian bookworm, nixos 26.05, nixpkgs unstable, ubuntu jammy

๐Ÿ’– SDL_VideoInfo โ€” Video Target information ๐Ÿ’–

okay bestie, pull up a chair, because this is the SDL_VideoInfo(3) page from the SDL API Reference and it's literally just a lil struct that tells you everything about your video setup ๐Ÿฆ‹ no cap.


๐ŸŒธ STRUCTURE DEFINITION ๐ŸŒธ

here's the whole thing, copy it exactly how it is, don't be cute with it:

typedef struct{
  Uint32 hw_available:1;
  Uint32 wm_available:1;
  Uint32 blit_hw:1;
  Uint32 blit_hw_CC:1;
  Uint32 blit_hw_A:1;
  Uint32 blit_sw:1;
  Uint32 blit_sw_CC:1;
  Uint32 blit_sw_A:1;
  Uint32 blit_fill;
  Uint32 video_mem;
  SDL_PixelFormat *vfmt;
} SDL_VideoInfo;

look at those bitfields. she's serving structure. ๐Ÿ’…


โœจ STRUCTURE DATA โœจ

every single member, one by one, no skipping, we don't do that here:

  • hw_available โ€” can you actually make hardware surfaces? is it possible, yes or no ๐Ÿ‘€
  • wm_available โ€” is there a window manager hanging around?
  • blit_hw โ€” are hardware-to-hardware blits accelerated? ๐Ÿ”ฅ
  • blit_hw_CC โ€” are hardware-to-hardware colorkey blits accelerated?
  • blit_hw_A โ€” are hardware-to-hardware alpha blits accelerated?
  • blit_sw โ€” are software-to-hardware blits accelerated?
  • blit_sw_CC โ€” are software-to-hardware colorkey blits accelerated?
  • blit_sw_A โ€” are software-to-hardware alpha blits accelerated?
  • blit_fill โ€” are color fills accelerated?
  • video_mem โ€” total amount of video memory, in Kilobytes ๐Ÿงฎ
  • vfmt โ€” pixel format of the video device, an SDL_PixelFormat * bestie

๐Ÿ’ซ DESCRIPTION ๐Ÿ’ซ

so this structure is read-only โ€” hands off, you don't write to it โ€” and SDL_GetVideoInfo is the one that hands it to you. ๐Ÿซถ

and what's inside? the tea on either:

  • the 'best' available mode, if you called it before SDL_SetVideoMode, or
  • the current video mode, if you didn't.

that's the whole vibe. one struct, two possible moods, depending on when you ask. main character energy tbh.

ngl the timing thing is the whole point โ€” ask early and you get the dream scenario, ask late and you get the reality check. ๐Ÿ‘‘

๐Ÿ” SEE ALSO ๐Ÿ”

  • SDL_PixelFormat
  • SDL_GetVideoInfo

go read those too, iykyk ๐Ÿ“š


and that's the page!! this lil slice of the SDL API Reference is brought to you by SDL, dated Tue 11 Sep 2001, 23:01 โ€” yes that date, iconic, historic, we respect it. mwah, bye bestie ๐Ÿ’œ๐ŸŽ€

๐Ÿ“ฆ where this page comes from