SDL_SysWMinfo structure hooks into the windows handle and DC

I came upon this on a site:

/* The windows custom window manager information structure /
typedef struct SDL_SysWMinfo {
SDL_version version;
HWND window; /
The Win32 display window /
HGLRC hglrc; /
The OpenGL context, if any */
} SDL_SysWMinfo;


  • This function gives you custom hooks into the window manager
  • It fills the structure pointed to by ‘info’ with custom information and
  • returns 1 if the function is implemented. If it’s not implemented, or
  • the version member of the ‘info’ structure is invalid, it returns 0.
    extern DECLSPEC int SDLCALL SDL_GetWMInfo(SDL_SysWMinfo *info);

The site is in German (

  • but I can barely read German, although the poster does say that it is
    only documented in the source code and does not know how to use it
    himself (as was the reply, who only has 2 years experience). I checked
    the SDL source code for its existence, and indeed it is there.

So how can I use this to hook the Windows window handle so that SDL will
render to its device?