Something went wrong. Try again.
Windows, a GPU renderer and text for Zig programs that draw their own interface.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105// SPDX-FileCopyrightText: © 2026 Jeffrey C. Ollie <jeff@ocjtech.us>// SPDX-License-Identifier: MIT
//! zig-aerie: windows, a GPU renderer, and text for programs that draw//! their own interface.//!//! - `platform` is the window system, Wayland on Linux and Win32 on//! Windows: windows, their sizes and scale, the keyboard (through xkb//! with Compose on Wayland), the pointer, the clipboard and the primary//! selection, input methods, cursor shapes, drag and drop.//! - `gpu` draws a frame — solid rectangles and frames, lines, discs,//! triangles and polygons, glyphs out of an atlas, images — with Vulkan.//! On Wayland it hands the frame to the compositor as a dma-buf, or//! through shared memory where nothing can be shared; on Windows it//! presents through a swapchain.//! - `decor` is a title bar and frame, for a compositor that draws none.//! - `text` finds fonts the way fontconfig does, shapes lines of text in//! them, and rasterizes their glyphs into the atlases `gpu` draws from.//! - `desktop` is what the desktop says it prefers, through the XDG desktop//! portal: light or dark, contrast, the accent color, and any other//! setting it publishes; on Windows, light or dark and the accent color,//! from the registry.//!//! An application owns its loop: it waits on the platform, alongside//! anything else of its own to wait on, takes the events that came, and draws//! a window when the compositor is ready for a frame.
pub const platform = @import("platform/platform.zig");
pub const gpu = struct { pub const Device = @import("gpu/Device.zig"); pub const Renderer = @import("gpu/Renderer.zig"); pub const Target = @import("gpu/Target.zig"); pub const Canvas = @import("gpu/Canvas.zig"); pub const image = @import("gpu/image.zig"); /// The renderer's instances drawn on the CPU. pub const cpu = @import("gpu/cpu.zig");};
/// What a window draws around its content when the compositor will not.pub const decor = struct { pub const TitleBar = @import("decor/TitleBar.zig");};
/// The desktop's settings, and word when they change.pub const desktop = struct { pub const settings = @import("desktop/settings.zig"); pub const Settings = settings.Settings; pub const Appearance = settings.Appearance; /// The portal's, or on Windows, the registry's. pub const Watcher = if (@import("builtin").os.tag == .windows) @import("desktop/Win32Watcher.zig") else @import("desktop/Watcher.zig");};
pub const text = struct { pub const Fonts = @import("text/Fonts.zig"); pub const Family = @import("text/Family.zig"); pub const Shaper = @import("text/Shaper.zig"); pub const Glyphs = @import("text/Glyphs.zig"); pub const Atlas = @import("text/Atlas.zig"); pub const emoji = @import("text/emoji.zig");};
test { _ = @import("testing.zig"); _ = platform.backend; // Nothing in these calls Windows, so they are tested anywhere. _ = @import("platform/win32/formats.zig"); _ = @import("platform/win32/keymap.zig"); _ = platform.event; _ = gpu.Device; _ = gpu.Renderer; _ = gpu.Target; _ = gpu.image; _ = @import("gpu/dmabuf.zig"); switch (@import("builtin").os.tag) { .linux => { _ = @import("gpu/wayland/Shm.zig"); _ = @import("gpu/wayland/Dmabuf.zig"); }, .windows => { _ = @import("gpu/win32/Swapchain.zig"); _ = @import("platform/win32/theme.zig"); _ = @import("platform/win32/elevation.zig"); }, else => {}, } _ = gpu.Canvas; _ = decor.TitleBar; _ = gpu.cpu; _ = text.Fonts; _ = text.Atlas; _ = text.emoji; _ = text.Family; _ = text.Shaper; _ = text.Glyphs; _ = desktop.settings; _ = desktop.Watcher; // Compiled whole, though nothing in a test calls it, so that the // Windows build checks every function and not just the type. if (@import("builtin").os.tag == .windows) @import("std").testing.refAllDecls(desktop.Watcher);}