Closed eddineimad0 closed 9 months ago
0.11.0
const std = @import("std"); pub const WGLExt = packed struct { ARB_multisample: bool, ARB_framebuffer_sRGB: bool, EXT_framebuffer_sRGB: bool, ARB_create_context: bool, ARB_create_context_profile: bool, EXT_create_context_es2_profile: bool, ARB_create_context_robustness: bool, ARB_create_context_no_error: bool, EXT_swap_control: bool, EXT_colorspace: bool, ARB_pixel_format: bool, ARB_context_flush_control: bool, }; var ext = WGLExt{ .ARB_multisample = false, .ARB_framebuffer_sRGB = false, .EXT_framebuffer_sRGB = false, .ARB_create_context = false, .ARB_create_context_profile = false, .EXT_create_context_es2_profile = false, .ARB_create_context_robustness = false, .ARB_create_context_no_error = false, .EXT_swap_control = false, .EXT_colorspace = false, .ARB_pixel_format = false, .ARB_context_flush_control = false, }; pub fn main() !void { ext.ARB_multisample = true; ext.ARB_framebuffer_sRGB = true; ext.ARB_create_context = true; ext.ARB_pixel_format = true; ext.ARB_context_flush_control = true; ext.ARB_create_context_profile = true; ext.ARB_create_context_robustness = true; ext.ARB_create_context_no_error = true; ext.EXT_swap_control = true; ext.EXT_colorspace = true; ext.EXT_framebuffer_sRGB = true; ext.EXT_create_context_es2_profile = true; std.debug.print("ext={}\n", .{ext}); }
ext=main.WGLExt{ .ARB_multisample = true, .ARB_framebuffer_sRGB = true, .EXT_framebuffer_sRGB = true, .ARB_create_context = true, .ARB_create_context_profile = true, .EXT_create_context_es2_profile = true, .ARB_create_context_robustness = true, .ARB_create_context_no_error = true, .EXT_swap_control = false, .EXT_colorspace = true, .ARB_pixel_format = true, .ARB_context_flush_control = true }
I encountered the bug on windows x86_64, i don't know if it's reproducible on other platforms.
ext.EXT_swap_control should be set to true
ext.EXT_swap_control
moving ext variable from global scope to function local scope seems to produce the correct output.
ext
Fixed in master.
Zig Version
0.11.0
Steps to Reproduce and Observed Behavior
Code
Output:
Platform
I encountered the bug on windows x86_64, i don't know if it's reproducible on other platforms.
Expected Behavior
ext.EXT_swap_control
should be set to true