feat(gui): M1 shared core — extract src/gui/ and replace -Dgui with -Drenderer

Move shared types out of src/win32/ into a new src/gui/ package:
- xy.zig: generic XY(T) coordinate type
- xterm.zig: 256-color palette table (used by all GPU renderers)
- GlyphIndexCache.zig: glyph→atlas-slot mapping
- Cell.zig: Rgba8 and Cell extracted from d3d11.zig
- GlyphRasterizer.zig: comptime interface spec/checker

Update src/win32/ imports to point to ../gui/ and delete the
moved originals.

Replace the -Dgui bool option with -Drenderer enum { terminal, gui,
d3d11 }, wiring .d3d11 to the existing win32 DirectWrite path and
keeping build_options.gui = (renderer != .terminal) for tui.zig.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
CJ van den Berg 2026-03-28 23:22:31 +01:00
parent a782bfb690
commit 9c66b19650
9 changed files with 101 additions and 44 deletions

View file

@ -5,7 +5,7 @@ const win32 = @import("win32").everything;
const win32ext = @import("win32ext.zig");
const dwrite = @import("dwrite.zig");
const XY = @import("xy.zig").XY;
const XY = @import("../gui/xy.zig").XY;
pub const Font = dwrite.Font;
pub const Fonts = dwrite.Fonts;