gpu: add SwapChain.configure

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-03-09 01:14:40 -07:00 committed by Stephen Gutekanst
parent f05fdf4414
commit 258db701a7
2 changed files with 22 additions and 1 deletions

View file

@ -484,6 +484,17 @@ const swap_chain_vtable = SwapChain.VTable{
c.wgpuSwapChainRelease(@ptrCast(c.WGPUSwapChain, ptr));
}
}).release,
.configure = (struct {
pub fn configure(ptr: *anyopaque, format: TextureFormat, allowed_usage: TextureUsage, width: u32, height: u32) void {
c.wgpuSwapChainConfigure(
@ptrCast(c.WGPUSwapChain, ptr),
@enumToInt(format),
@enumToInt(allowed_usage),
width,
height,
);
}
}).configure,
};
test "syntax" {