example: Cheap fix to make the window resizable on wl

This commit is contained in:
Robin Voetter
2021-11-08 14:06:00 +01:00
parent 8862336b77
commit c6b46172c8

View File

@@ -126,10 +126,11 @@ pub fn main() !void {
else => |narrow| return narrow, else => |narrow| return narrow,
}; };
if (state == .suboptimal) {
var w: c_int = undefined; var w: c_int = undefined;
var h: c_int = undefined; var h: c_int = undefined;
c.glfwGetWindowSize(window, &w, &h); c.glfwGetWindowSize(window, &w, &h);
if (state == .suboptimal or extent.width != @intCast(u32, w) or extent.height != @intCast(u32, h)) {
extent.width = @intCast(u32, w); extent.width = @intCast(u32, w);
extent.height = @intCast(u32, h); extent.height = @intCast(u32, h);
try swapchain.recreate(extent); try swapchain.recreate(extent);