The custom window manager information structure.
Defined in [SDL_syswm.h](https://github.com/libsdl-org/SDL/blob/SDL2/include/SDL_syswm.h)
struct SDL_SysWMinfo
{
SDL_version version;
SDL_SYSWM_TYPE subsystem;union
{#if defined(SDL_VIDEO_DRIVER_WINDOWS)
struct
{/**< The window handle */
HWND window; /**< The window device context */
HDC hdc; /**< The instance handle */
HINSTANCE hinstance;
} win;#endif
#if defined(SDL_VIDEO_DRIVER_WINRT)
struct
{/**< The WinRT CoreWindow */
IInspectable * window;
} winrt;#endif
#if defined(SDL_VIDEO_DRIVER_X11)
struct
{/**< The X11 display */
Display *display; /**< The X11 window */
Window window;
} x11;#endif
#if defined(SDL_VIDEO_DRIVER_DIRECTFB)
struct
{/**< The directfb main interface */
IDirectFB *dfb; /**< The directfb window handle */
IDirectFBWindow *window; /**< The directfb client surface */
IDirectFBSurface *surface;
} dfb;#endif
#if defined(SDL_VIDEO_DRIVER_COCOA)
struct
{#if defined(__OBJC__) && defined(__has_feature)
#if __has_feature(objc_arc)
/**< The Cocoa window */
NSWindow __unsafe_unretained *window; #else
/**< The Cocoa window */
NSWindow *window; #endif
#else
/**< The Cocoa window */
NSWindow *window; #endif
} cocoa;#endif
#if defined(SDL_VIDEO_DRIVER_UIKIT)
struct
{#if defined(__OBJC__) && defined(__has_feature)
#if __has_feature(objc_arc)
/**< The UIKit window */
UIWindow __unsafe_unretained *window; #else
/**< The UIKit window */
UIWindow *window; #endif
#else
/**< The UIKit window */
UIWindow *window; #endif
/**< The GL view's Framebuffer Object. It must be bound when rendering to the screen using GL. */
GLuint framebuffer; /**< The GL view's color Renderbuffer Object. It must be bound when SDL_GL_SwapWindow is called. */
GLuint colorbuffer; /**< The Framebuffer Object which holds the resolve color Renderbuffer, when MSAA is used. */
GLuint resolveFramebuffer;
} uikit;#endif
#if defined(SDL_VIDEO_DRIVER_WAYLAND)
struct
{struct wl_display *display; /**< Wayland display */
struct wl_surface *surface; /**< Wayland surface */
void *shell_surface; /**< DEPRECATED Wayland shell_surface (window manager handle) */
struct wl_egl_window *egl_window; /**< Wayland EGL window (native window) */
struct xdg_surface *xdg_surface; /**< Wayland xdg surface (window manager handle) */
struct xdg_toplevel *xdg_toplevel; /**< Wayland xdg toplevel role */
struct xdg_popup *xdg_popup; /**< Wayland xdg popup role */
struct xdg_positioner *xdg_positioner; /**< Wayland xdg positioner, for popup */
} wl;#endif
#if defined(SDL_VIDEO_DRIVER_MIR) /* no longer available, left for API/ABI compatibility. Remove in 2.1! */
struct
{void *connection; /**< Mir display server connection */
void *surface; /**< Mir surface */
} mir;#endif
#if defined(SDL_VIDEO_DRIVER_ANDROID)
struct
{
ANativeWindow *window;
EGLSurface surface;
} android;#endif
#if defined(SDL_VIDEO_DRIVER_OS2)
struct
{/**< The window handle */
HWND hwnd; /**< The frame window handle */
HWND hwndFrame;
} os2;#endif
#if defined(SDL_VIDEO_DRIVER_VIVANTE)
struct
{
EGLNativeDisplayType display;
EGLNativeWindowType window;
} vivante;#endif
#if defined(SDL_VIDEO_DRIVER_KMSDRM)
struct
{int dev_index; /**< Device index (ex: the X in /dev/dri/cardX) */
int drm_fd; /**< DRM FD (unavailable on Vulkan windows) */
struct gbm_device *gbm_dev; /**< GBM device (unavailable on Vulkan windows) */
} kmsdrm;#endif
/* Make sure this union is always 64 bytes (8 64-bit pointers). */
/* Be careful not to overflow this if you add a new target! */
64];
Uint8 dummy[
} info; };
When this structure is returned, it holds information about which low level system it is using, and will be one of SDL_SYSWM_TYPE.
All Subsystems |
||
version |
an SDL_version structure that contains the current SDL version |
|
subsystem |
the windowing system type; see Remarks for details |
|
int |
dummy |
unused (to help compilers when no specific system is available) |
SDL_SYSWM_WINDOWS |
||
HWND |
win.window |
the window handle |
HDC |
win.hdc |
the window device context (>= SDL 2.0.4) |
HINSTANCE |
win.hinstance |
the window hinstance (>= SDL 2.0.6) |
SDL_SYSWM_WINRT (>= SDL 2.0.3) |
||
IInspectable* |
winrt.window |
the WinRT CoreWindow |
SDL_SYSWM_X11 |
||
Display* |
x11.display |
the X11 display |
Window |
x11.window |
the X11 window |
SDL_SYSWM_DIRECTFB |
||
IDirectFB* |
dfb.dfb |
the DirectFB main interface |
IDirectFBWindow* |
dfb.window |
the DirectFB window handle |
IDirectFBSurface* |
dfb.surface |
the DirectFB client surface |
SDL_SYSWM_COCOA |
||
NSWindow* |
cocoa.window |
the Cocoa window |
SDL_SYSWM_UIKIT |
||
UIWindow* |
uikit.window |
the UIKit window |
GLuint |
uikit.framebuffer |
the GL view's Framebuffer Object; it must be bound when rendering to the screen using GL (>= SDL 2.0.4) |
GLuint |
uikit.colorbuffer |
the GL view's color Renderbuffer Object; it must be bound when SDL_GL_SwapWindow() is called (>= SDL 2.0.4) |
GLuint |
uikit.resolveFramebuffer |
the Framebuffer Object which holds the resolve color Renderbuffer, when MSAA is used (>= SDL 2.0.4) |
SDL_SYSWM_WAYLAND (>= SDL 2.0.2) |
||
wl_display* |
wl.display |
the Wayland display |
wl_surface* |
wl.surface |
the Wayland surface |
wl_shell_surface* |
wl.shell_surface |
the Wayland shell_surface (window manager handle) |
SDL_SYSWM_MIR (>= SDL 2.0.2) |
||
MirConnection* |
mir.connection |
the Mir display server connection |
MirSurface* |
mir.surface |
the Mir surface |
SDL_SYSWM_ANDROID (>= SDL 2.0.4) |
||
ANativeWindow* |
android.window |
the Android native window |
EGLSurface |
android.surface |
the Android EGL surface |
SDL_SYSWM_VIVANTE (>= SDL 2.0.5) |
||
EGLNativeDisplayType |
vivante.display |
the Vivante EGL display type |
EGLNativeWindowType |
vivante.window |
the Vivante EGL window type |
CategoryAPI, CategoryAPIStruct, CategoryStruct, CategorySWM