forked from mirror/vulkan-zig
example: Cheap fix to make the window resizable on wl
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user