diff --git a/build.zig b/build.zig index 4df9709c..1bca8f31 100644 --- a/build.zig +++ b/build.zig @@ -506,6 +506,10 @@ pub fn build_exe( .d3d11 => { const win32_dep = b.lazyDependency("win32", .{}) orelse break :blk tui_renderer_mod; 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(.{ .root_source_file = b.path("src/win32/gui.zig"), .imports = &.{ @@ -519,6 +523,10 @@ pub fn build_exe( .{ .name = "color", .module = color_mod }, .{ .name = "gui_config", .module = gui_config_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")); diff --git a/src/renderer/win32/renderer.zig b/src/renderer/win32/renderer.zig index 94827b6e..40e4d6a1 100644 --- a/src/renderer/win32/renderer.zig +++ b/src/renderer/win32/renderer.zig @@ -165,9 +165,10 @@ fn fmtmsg(self: *Self, value: anytype) std.Io.Writer.Error![]const u8 { return self.event_buffer.written(); } -pub fn render(self: *Self) error{}!void { - const hwnd = self.hwnd orelse return; +pub fn render(self: *Self) error{}!bool { + const hwnd = self.hwnd orelse return false; _ = gui.updateScreen(hwnd, &self.vx.screen); + return false; } pub fn stop(self: *Self) void { // this is guaranteed because stop won't be called until after diff --git a/src/win32/DwriteRenderer.zig b/src/win32/DwriteRenderer.zig index 003a2949..943b08ac 100644 --- a/src/win32/DwriteRenderer.zig +++ b/src/win32/DwriteRenderer.zig @@ -5,7 +5,7 @@ const win32 = @import("win32").everything; const win32ext = @import("win32ext.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 Fonts = dwrite.Fonts; diff --git a/src/win32/d3d11.zig b/src/win32/d3d11.zig index d7cd4359..f36fc9cb 100644 --- a/src/win32/d3d11.zig +++ b/src/win32/d3d11.zig @@ -4,11 +4,11 @@ const win32 = @import("win32").everything; const win32ext = @import("win32ext.zig"); const dwrite = @import("dwrite.zig"); -const GlyphIndexCache = @import("../gui/GlyphIndexCache.zig"); +const GlyphIndexCache = @import("GlyphIndexCache"); const TextRenderer = @import("DwriteRenderer.zig"); -const XY = @import("../gui/xy.zig").XY; -const gui_cell = @import("../gui/Cell.zig"); +const XY = @import("xy").XY; +const gui_cell = @import("Cell"); pub const Font = TextRenderer.Font; pub const Fonts = TextRenderer.Fonts; diff --git a/src/win32/dwrite.zig b/src/win32/dwrite.zig index 5ac809d8..e6405689 100644 --- a/src/win32/dwrite.zig +++ b/src/win32/dwrite.zig @@ -2,7 +2,7 @@ const std = @import("std"); const win32 = @import("win32").everything; const FontFace = @import("FontFace.zig"); -const XY = @import("xy.zig").XY; +const XY = @import("xy").XY; const global = struct { var init_called: bool = false; diff --git a/src/win32/gui.zig b/src/win32/gui.zig index 6b8c4efb..766032a5 100644 --- a/src/win32/gui.zig +++ b/src/win32/gui.zig @@ -18,10 +18,10 @@ const input = @import("input"); const windowmsg = @import("windowmsg.zig"); const render = @import("d3d11.zig"); -const xterm = @import("../gui/xterm.zig"); +const xterm = @import("xterm"); 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_SET_BACKGROUND = win32.WM_APP + 2;