From 5c5990a84f857ffa69e13b1ce6aee23c42f304ca Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Sun, 24 Jul 2022 14:59:41 -0700 Subject: [PATCH] gpu: convert SwapChain from enum(usize) to *opaque Signed-off-by: Stephen Gutekanst --- gpu/src/swap_chain.zig | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/gpu/src/swap_chain.zig b/gpu/src/swap_chain.zig index 7945dbe3..b59391a0 100644 --- a/gpu/src/swap_chain.zig +++ b/gpu/src/swap_chain.zig @@ -2,20 +2,15 @@ const ChainedStruct = @import("types.zig").ChainedStruct; const PresentMode = @import("types.zig").PresentMode; const Texture = @import("texture.zig").Texture; -pub const SwapChain = enum(usize) { - _, +pub const SwapChain = *opaque {}; - // TODO: verify there is a use case for nullable value of this type. - pub const none: SwapChain = @intToEnum(SwapChain, 0); - - pub const Descriptor = extern struct { - next_in_chain: *const ChainedStruct, - label: ?[*:0]const u8 = null, - usage: Texture.UsageFlags, - format: Texture.Format, - width: u32, - height: u32, - present_mode: PresentMode, - implementation: u64, - }; +pub const SwapChainDescriptor = extern struct { + next_in_chain: *const ChainedStruct, + label: ?[*:0]const u8 = null, + usage: Texture.UsageFlags, + format: Texture.Format, + width: u32, + height: u32, + present_mode: PresentMode, + implementation: u64, };