sdl_syswm

syswm.nim

Include file for SDL custom system window manager hooks.

Your application has access to a special type of event SYSWMEVENT, which contains window-manager specific information and arrives whenever an unhandled window event occurs. This event is ignored by default, but you can enable it with eventState().

Types

SysWMKind {...}{.size: 4.} = enum
  SYSWM_UNKNOWN, SYSWM_WINDOWS, SYSWM_X11, SYSWM_DIRECTFB, SYSWM_COCOA,
  SYSWM_UIKIT, SYSWM_WAYLAND, SYSWM_MIR, SYSWM_WINRT, SYSWM_ANDROID,
  SYSWM_VIVANTE, SYSWM_OS2, SYSWM_HAIKU
These are the various supported windowing subsystems
SysWMMsgKindObj = object
  dummy*: cint
SysWMMsg = ptr SysWMMsgObj
SysWMMsgObj = object
  version*: Version
  subsystem*: SysWMKind
  msg*: SysWMMsgKindObj
The custom event structure.
SysWMinfoKindObj = object
  dummy*: array[64, uint8] ## Make sure this union is always 64 bytes (8 64-bit pointers).
                           ## Be careful not to overflow this if you add a new target!
  
SysWMinfo = object
  version*: Version
  subsystem*: SysWMKind
  info*: SysWMinfoKindObj

The custom window manager information structure.

When this structure is returned, it holds information about which low level system it is using, and will be one of SysWMKind.

Procs

proc getWindowWMInfo(window: Window; info: ptr SysWMinfo): bool {...}{.cdecl,
    importc: "SDL_GetWindowWMInfo", dynlib: SDL2_LIB.}

This procedure allows access to driver-dependent window information.

window The window about which information is being requested

info This object must be initialized with the SDL version, and is then filled in with information about the given window.

Return true if the procedure is implemented and the version member of the info object is valid, false otherwise.

You typically use this procedure like this:

var info: SysWMinfo
version(info.version);
if getWindowWMInfo(window, addr(info))"
  ...