Skip to content

Commit 19bcf53

Browse files
committed
Redraw on resize
1 parent f2c18c8 commit 19bcf53

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/main.zig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,19 @@ pub fn main() !void {
3939

4040
while (!window.shouldClose()) {
4141
zglfw.pollEvents();
42+
43+
const swapchain_texv = gctx.swapchain.getCurrentTextureView();
44+
defer swapchain_texv.release();
45+
46+
const commands = commands: {
47+
const encoder = gctx.device.createCommandEncoder(null);
48+
defer encoder.release();
49+
50+
break :commands encoder.finish(null);
51+
};
52+
defer commands.release();
53+
54+
gctx.submit(&.{commands});
55+
_ = gctx.present();
4256
}
4357
}

0 commit comments

Comments
 (0)