fix(win32): fix d3d11 gui build

This commit is contained in:
CJ van den Berg 2026-04-07 16:26:49 +02:00
parent 1c1886defc
commit 32ed60bc64
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
6 changed files with 18 additions and 9 deletions

View file

@ -506,6 +506,10 @@ pub fn build_exe(
.d3d11 => { .d3d11 => {
const win32_dep = b.lazyDependency("win32", .{}) orelse break :blk tui_renderer_mod; const win32_dep = b.lazyDependency("win32", .{}) orelse break :blk tui_renderer_mod;
const win32_mod = win32_dep.module("win32"); const win32_mod = win32_dep.module("win32");
const gui_xy_mod = b.createModule(.{ .root_source_file = b.path("src/gui/xy.zig") });
const gui_cell_mod = b.createModule(.{ .root_source_file = b.path("src/gui/Cell.zig") });
const gui_glyph_cache_mod = b.createModule(.{ .root_source_file = b.path("src/gui/GlyphIndexCache.zig") });
const gui_xterm_mod = b.createModule(.{ .root_source_file = b.path("src/gui/xterm.zig") });
const gui_mod = b.createModule(.{ const gui_mod = b.createModule(.{
.root_source_file = b.path("src/win32/gui.zig"), .root_source_file = b.path("src/win32/gui.zig"),
.imports = &.{ .imports = &.{
@ -519,6 +523,10 @@ pub fn build_exe(
.{ .name = "color", .module = color_mod }, .{ .name = "color", .module = color_mod },
.{ .name = "gui_config", .module = gui_config_mod }, .{ .name = "gui_config", .module = gui_config_mod },
.{ .name = "tracy", .module = tracy_mod }, .{ .name = "tracy", .module = tracy_mod },
.{ .name = "xy", .module = gui_xy_mod },
.{ .name = "Cell", .module = gui_cell_mod },
.{ .name = "GlyphIndexCache", .module = gui_glyph_cache_mod },
.{ .name = "xterm", .module = gui_xterm_mod },
}, },
}); });
gui_mod.addIncludePath(b.path("src/win32")); gui_mod.addIncludePath(b.path("src/win32"));

View file

@ -165,9 +165,10 @@ fn fmtmsg(self: *Self, value: anytype) std.Io.Writer.Error![]const u8 {
return self.event_buffer.written(); return self.event_buffer.written();
} }
pub fn render(self: *Self) error{}!void { pub fn render(self: *Self) error{}!bool {
const hwnd = self.hwnd orelse return; const hwnd = self.hwnd orelse return false;
_ = gui.updateScreen(hwnd, &self.vx.screen); _ = gui.updateScreen(hwnd, &self.vx.screen);
return false;
} }
pub fn stop(self: *Self) void { pub fn stop(self: *Self) void {
// this is guaranteed because stop won't be called until after // this is guaranteed because stop won't be called until after

View file

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

View file

@ -4,11 +4,11 @@ const win32 = @import("win32").everything;
const win32ext = @import("win32ext.zig"); const win32ext = @import("win32ext.zig");
const dwrite = @import("dwrite.zig"); const dwrite = @import("dwrite.zig");
const GlyphIndexCache = @import("../gui/GlyphIndexCache.zig"); const GlyphIndexCache = @import("GlyphIndexCache");
const TextRenderer = @import("DwriteRenderer.zig"); const TextRenderer = @import("DwriteRenderer.zig");
const XY = @import("../gui/xy.zig").XY; const XY = @import("xy").XY;
const gui_cell = @import("../gui/Cell.zig"); const gui_cell = @import("Cell");
pub const Font = TextRenderer.Font; pub const Font = TextRenderer.Font;
pub const Fonts = TextRenderer.Fonts; pub const Fonts = TextRenderer.Fonts;

View file

@ -2,7 +2,7 @@ const std = @import("std");
const win32 = @import("win32").everything; const win32 = @import("win32").everything;
const FontFace = @import("FontFace.zig"); const FontFace = @import("FontFace.zig");
const XY = @import("xy.zig").XY; const XY = @import("xy").XY;
const global = struct { const global = struct {
var init_called: bool = false; var init_called: bool = false;

View file

@ -18,10 +18,10 @@ const input = @import("input");
const windowmsg = @import("windowmsg.zig"); const windowmsg = @import("windowmsg.zig");
const render = @import("d3d11.zig"); const render = @import("d3d11.zig");
const xterm = @import("../gui/xterm.zig"); const xterm = @import("xterm");
const FontFace = @import("FontFace.zig"); const FontFace = @import("FontFace.zig");
const XY = @import("../gui/xy.zig").XY; const XY = @import("xy").XY;
const WM_APP_EXIT = win32.WM_APP + 1; const WM_APP_EXIT = win32.WM_APP + 1;
const WM_APP_SET_BACKGROUND = win32.WM_APP + 2; const WM_APP_SET_BACKGROUND = win32.WM_APP + 2;