gpu: add SwapChain.configure
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
f05fdf4414
commit
258db701a7
2 changed files with 22 additions and 1 deletions
|
|
@ -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" {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue