gpu: use Surface API in example
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
8f5e9f89e5
commit
9916ec043b
2 changed files with 27 additions and 39 deletions
|
|
@ -2,6 +2,7 @@ const std = @import("std");
|
|||
const sample_utils = @import("sample_utils.zig");
|
||||
const c = @import("c.zig").c;
|
||||
const glfw = @import("glfw");
|
||||
const gpu = @import("gpu");
|
||||
|
||||
pub fn main() !void {
|
||||
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
|
||||
|
|
@ -37,11 +38,12 @@ pub fn main() !void {
|
|||
.presentMode = c.WGPUPresentMode_Fifo,
|
||||
.implementation = 0,
|
||||
};
|
||||
window_data.surface = sample_utils.createSurfaceForWindow(
|
||||
setup.instance,
|
||||
const surface = sample_utils.createSurfaceForWindow(
|
||||
&setup.native_instance,
|
||||
setup.window,
|
||||
comptime sample_utils.detectGLFWOptions(),
|
||||
);
|
||||
window_data.surface = @ptrCast(c.WGPUSurface, surface.ptr);
|
||||
} else {
|
||||
const binding = c.machUtilsCreateBinding(setup.backend_type, @ptrCast(*c.GLFWwindow, setup.window.handle), setup.device);
|
||||
if (binding == null) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue