From d94b3c4e9333cdcbf1c1e37d19b003d82436ffd3 Mon Sep 17 00:00:00 2001 From: kk Date: Tue, 11 Mar 2025 17:34:09 +0800 Subject: [PATCH 1/2] Add activeTexture function to the wrapper as well as the TexUnit enum. Update zon name feild and add fingerprint --- build.zig.zon | 3 ++- src/wrapper.zig | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/build.zig.zon b/build.zig.zon index 5ee28ef..9fdf871 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -1,6 +1,7 @@ .{ - .name = "zopengl", + .name = .zopengl, .version = "0.6.0-dev", + .fingerprint = 0xf50d3c53be7368f1, .paths = .{ "build.zig", "build.zig.zon", diff --git a/src/wrapper.zig b/src/wrapper.zig index db29ad6..d2c7d1a 100644 --- a/src/wrapper.zig +++ b/src/wrapper.zig @@ -677,6 +677,41 @@ pub fn Wrap(comptime bindings: anytype) type { texture_cube_map_array = TEXTURE_CUBE_MAP_ARRAY, }; + pub const TexUnit = enum(Enum) { + texture_0 = TEXTURE0, + texture_1 = TEXTURE1, + texture_2 = TEXTURE2, + texture_3 = TEXTURE3, + texture_4 = TEXTURE4, + texture_5 = TEXTURE5, + texture_6 = TEXTURE6, + texture_7 = TEXTURE7, + texture_8 = TEXTURE8, + texture_9 = TEXTURE9, + texture_10 = TEXTURE10, + texture_11 = TEXTURE11, + texture_12 = TEXTURE12, + texture_13 = TEXTURE13, + texture_14 = TEXTURE14, + texture_15 = TEXTURE15, + texture_16 = TEXTURE16, + texture_17 = TEXTURE17, + texture_18 = TEXTURE18, + texture_19 = TEXTURE19, + texture_20 = TEXTURE20, + texture_21 = TEXTURE21, + texture_22 = TEXTURE22, + texture_23 = TEXTURE23, + texture_24 = TEXTURE24, + texture_25 = TEXTURE25, + texture_26 = TEXTURE26, + texture_27 = TEXTURE27, + texture_28 = TEXTURE28, + texture_29 = TEXTURE29, + texture_30 = TEXTURE30, + texture_31 = TEXTURE31, + }; + pub const TexImageTarget = enum(Enum) { //-------------------------------------------------------------------------------------- // OpenGL 1.0 (Core Profile) @@ -2156,6 +2191,9 @@ pub fn Wrap(comptime bindings: anytype) type { pub const CLAMP_TO_BORDER = bindings.CLAMP_TO_BORDER; // pub var activeTexture: *const fn (texture: Enum) callconv(.C) void = undefined; + pub fn activeTexture(texture_unit: TexUnit) void { + bindings.activeTexture(@intFromEnum(texture_unit)); + } // pub var sampleCoverage: *const fn (value: Float, invert: Boolean) callconv(.C) void = undefined; // pub var compressedTexImage3D: *const fn ( // target: Enum, From 23cbe3f614467e7e8d2233f73713f5c4891361ca Mon Sep 17 00:00:00 2001 From: KK <82811712+KarthikKaravatt@users.noreply.github.com> Date: Tue, 11 Mar 2025 22:14:27 +0800 Subject: [PATCH 2/2] Update build.zig.zon Revert zon changes, Didn't realize we were using mach nominated version! --- build.zig.zon | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build.zig.zon b/build.zig.zon index 9fdf871..5ee28ef 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -1,7 +1,6 @@ .{ - .name = .zopengl, + .name = "zopengl", .version = "0.6.0-dev", - .fingerprint = 0xf50d3c53be7368f1, .paths = .{ "build.zig", "build.zig.zon",