From 48dee0817f5fe8c09a085f0150e0c6b4a699ab7c Mon Sep 17 00:00:00 2001 From: tslil clingman <> Date: Wed, 27 Oct 2021 15:37:28 -0400 Subject: Update SFML wrapper --- src/sfml/window/context_settings.zig | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/sfml/window/context_settings.zig (limited to 'src/sfml/window/context_settings.zig') diff --git a/src/sfml/window/context_settings.zig b/src/sfml/window/context_settings.zig new file mode 100644 index 0000000..19b8f03 --- /dev/null +++ b/src/sfml/window/context_settings.zig @@ -0,0 +1,28 @@ +const sf = @import("../sfml.zig"); + +pub const ContextSettings = packed struct { + const PaddingType = @import("std").meta.Int(.unsigned, @bitSizeOf(c_int) - @bitSizeOf(bool)); + + depth_bits: c_uint = 0, + stencil_bits: c_uint = 0, + antialiasing_level: c_uint = 0, + major_version: c_uint = 1, + minor_version: c_uint = 1, + attribute_flags: u32 = 0, + srgb_capable: bool = false, + _padding: PaddingType = 0, + + pub const Attribute = struct { + pub const default: u32 = 0; + pub const core: u32 = 1; + pub const debug: u32 = 4; + }; + + pub fn _toCSFML(self: ContextSettings) sf.c.sfContextSettings { + return @bitCast(sf.c.sfContextSettings, self); + } + + pub fn _fromCSFML(context_settings: sf.c.sfContextSettings) ContextSettings { + return @bitCast(ContextSettings, context_settings); + } +}; \ No newline at end of file -- cgit v1.3.1