Skip to content

ypsvlq/wio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wio

wio is a window system abstraction library.

Getting started

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.

Platform notes

Windows

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.

macOS

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

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.

Platform-specific API

The following variables and fields may be considered part of the public API when targeting a given platform:

Windows

  • Window.backend.window is the Win32 HWND

macOS

  • Window.backend.window is the AppKit NSWindow*

Unix

wio.backend.active is an enum describing the backend in use:

.x11

  • wio.backend.x11.display is the Xlib display
  • Window.backend.x11.window is the Xlib window

.wayland

  • wio.backend.wayland.display is the Wayland wl_display*
  • Window.backend.wayland.surface is the Wayland wl_surface*

About

windowed i/o

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published