whoa triangul
This commit is contained in:
parent
fc49e6dba4
commit
db98278940
|
@ -47,7 +47,7 @@ pub fn main() !void {
|
|||
|
||||
var extent = vk.Extent2D{ .width = 1280, .height = 720 };
|
||||
|
||||
var window = try glfw.Window.create(extent.width, extent.height, app_name, null, null, .{});
|
||||
var window = try glfw.Window.create(extent.width, extent.height, app_name, null, null, .{ .client_api = .no_api });
|
||||
defer window.destroy();
|
||||
|
||||
// temp allocator
|
||||
|
|
|
@ -113,10 +113,10 @@ pub const GraphicsContext = struct {
|
|||
.enabled_layer_count = 0,
|
||||
.pp_enabled_layer_names = undefined,
|
||||
.enabled_extension_count = @intCast(u32, glfw_exts.len),
|
||||
.pp_enabled_extension_names = @ptrCast([*]const [*:0]const u8, glfw_exts),
|
||||
.pp_enabled_extension_names = glfw_exts.ptr,
|
||||
}, null);
|
||||
|
||||
self.vki = try InstanceDispatch.load(self.instance, glfw.getInstanceProcAddress);
|
||||
self.vki = try InstanceDispatch.load(self.instance, getInstanceProcWrapper);
|
||||
errdefer self.vki.destroyInstance(self.instance, null);
|
||||
|
||||
self.surface = try createSurface(self.instance, window);
|
||||
|
@ -166,8 +166,9 @@ pub const GraphicsContext = struct {
|
|||
}, null);
|
||||
}
|
||||
|
||||
// hacky?
|
||||
fn getInstanceProcWrapper(inst: vk.Instance, name: [*:0]const u8) ?glfw.VKProc {
|
||||
return glfw.getInstanceProcAddress(&inst, name);
|
||||
return glfw.getInstanceProcAddress(@intToPtr(?*anyopaque, @enumToInt(inst)), name);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue