wio is a window system abstraction library.
wio follows the Mach nominated Zig version.
The public API can be browsed in src/wio.zig. The example directory contains a test program covering most features.
By default, wio embeds an application manifest for proper functionality.
When using a custom manifest, set the win32_manifest
build option to false.
If audio is enabled, wio initializes COM with options COINIT_MULTITHREADED
and COINIT_DISABLE_OLE1DDE
.
Versions 10.15 and above are supported.
The example directory contains an application bundle, which can be adapted by
changing the CFBundleExecutable
and CFBundleName
values in Info.plist.
Unix-like systems support different backends in the same executable, with the
most appropriate being chosen at runtime. To restrict the available choices,
set the unix_backends
build option to a comma-separated list.
For X11, the following libraries are loaded:
libX11.so.6
libXcursor.so.1
libGL.so.1
(if OpenGL is enabled)
For Wayland, the following libraries are loaded:
libwayland-client.so.0
libxkbcommon.so.0
libdecor-0.so.0
libwayland-egl.so.1
(if OpenGL is enabled)libEGL.so.1
(if OpenGL is enabled)
When building for Linux with audio enabled, libpulse.so.0
is loaded.
The following variables and fields may be considered part of the public API when targeting a given platform:
Window.backend.window
is the Win32HWND
Window.backend.window
is the AppKitNSWindow*
wio.backend.active
is an enum describing the backend in use:
wio.backend.x11.display
is the Xlib displayWindow.backend.x11.window
is the Xlib window
wio.backend.wayland.display
is the Waylandwl_display*
Window.backend.wayland.surface
is the Waylandwl_surface*