gpu: internalize SwapChain types

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-07-30 00:02:25 -07:00 committed by Stephen Gutekanst
parent 9d367c3957
commit e9dcb49328
3 changed files with 16 additions and 17 deletions

View file

@ -7,6 +7,18 @@ const TextureView = @import("texture_view.zig").TextureView;
const Impl = @import("interface.zig").Impl;
pub const SwapChain = opaque {
pub const Descriptor = extern struct {
next_in_chain: ?*const ChainedStruct = null,
label: ?[*:0]const u8 = null,
usage: TextureUsageFlags,
format: TextureFormat,
width: u32,
height: u32,
present_mode: PresentMode,
/// deprecated
implementation: u64 = 0,
};
pub inline fn configure(swap_chain: *SwapChain, format: TextureFormat, allowed_usage: TextureUsageFlags, width: u32, height: u32) void {
Impl.swapChainConfigure(swap_chain, format, allowed_usage, width, height);
}
@ -27,15 +39,3 @@ pub const SwapChain = opaque {
Impl.swapChainRelease(swap_chain);
}
};
pub const SwapChainDescriptor = extern struct {
next_in_chain: ?*const ChainedStruct = null,
label: ?[*:0]const u8 = null,
usage: TextureUsageFlags,
format: TextureFormat,
width: u32,
height: u32,
present_mode: PresentMode,
/// deprecated
implementation: u64 = 0,
};