gpu: use SwapChain.configure in example

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-03-09 01:14:57 -07:00 committed by Stephen Gutekanst
parent 258db701a7
commit 0017303cde

View file

@ -51,10 +51,9 @@ pub fn main() !void {
window_data.swap_chain = setup.device.nativeCreateSwapChain(null, &descriptor);
window_data.swap_chain_format = @intToEnum(gpu.TextureFormat, @intCast(u32, c.machUtilsBackendBinding_getPreferredSwapChainTextureFormat(binding)));
c.wgpuSwapChainConfigure(
@ptrCast(c.WGPUSwapChain, window_data.swap_chain.?.ptr),
@enumToInt(window_data.swap_chain_format),
c.WGPUTextureUsage_RenderAttachment,
window_data.swap_chain.?.configure(
window_data.swap_chain_format,
.RenderAttachment,
framebuffer_size.width,
framebuffer_size.height,
);