gpu: implement SwapChain.present, SwapChain.getCurrentTextureView

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-03-11 20:14:58 -07:00 committed by Stephen Gutekanst
parent cc40004a5f
commit ef3eed7afb
2 changed files with 22 additions and 3 deletions

View file

@ -587,6 +587,16 @@ const swap_chain_vtable = SwapChain.VTable{
);
}
}).configure,
.getCurrentTextureView = (struct {
pub fn getCurrentTextureView(ptr: *anyopaque) TextureView {
return wrapTextureView(c.wgpuSwapChainGetCurrentTextureView(@ptrCast(c.WGPUSwapChain, ptr)));
}
}).getCurrentTextureView,
.present = (struct {
pub fn present(ptr: *anyopaque) void {
c.wgpuSwapChainPresent(@ptrCast(c.WGPUSwapChain, ptr));
}
}).present,
};
fn wrapTextureView(texture_view: c.WGPUTextureView) TextureView {