Skip to content

Commit 9eb0e23

Browse files
committed
Bump version to 0.2.2
1 parent 53b64ae commit 9eb0e23

File tree

8 files changed

+43
-23
lines changed

8 files changed

+43
-23
lines changed

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,18 @@ The only Zig OpenGL binding generator you need.
44

55
## Installation and usage
66

7-
zigglgen requires a recent-ish master build of the Zig compiler. The oldest known supported version is
8-
`0.12.0-dev.2063+804cee3b9` (identical to [`2024.1.0-mach`](https://machengine.org/about/nominated-zig/#202410-mach)),
9-
but more recent versions may also work.
7+
zigglgen officially supports the following versions of the Zig compiler:
8+
9+
- `0.12.0-dev.3180+83e578a18`/[`2024.3.0-mach`](https://machengine.org/about/nominated-zig/#202410-mach)
10+
- `0.12.0`
11+
- master (last tested with `0.13.0-dev.73+db890dbae`)
12+
13+
Older or more recent versions of the compiler are not guaranteed to be compatible.
1014

1115
1\. Run `zig fetch` to add the zigglgen package to your `build.zig.zon` manifest:
1216

1317
```sh
14-
zig fetch https://github.com/castholm/zigglgen/releases/download/v0.2.1/zigglgen.tar.gz --save
18+
zig fetch https://github.com/castholm/zigglgen/releases/download/v0.2.2/zigglgen.tar.gz --save
1519
```
1620

1721
2\. Generate a set of OpenGL bindings in your `build.zig` build script:

zigglgen-example/build.zig.zon

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
.version = "0.0.0",
44
.dependencies = .{
55
.@"mach-glfw" = .{
6-
.url = "https://pkg.machengine.org/mach-glfw/63da35e57c3695a787b927e69e4140eb74ffc234.tar.gz",
7-
.hash = "1220fda87b59df6353864651cdd3943f1159d8d517a45cd67bed493fe6c0a0c78c17",
6+
.url = "https://pkg.machengine.org/mach-glfw/42fe7ee494d36bee8a82c1563c291d8314a41823.tar.gz",
7+
.hash = "1220a72c54b4a3674a1e5a907ac6ea33d1868681f187f5a07f3cfb562ff7cf2c63e0",
88
},
99
.zigglgen = .{
10-
.url = "https://github.com/castholm/zigglgen/releases/download/v0.2.1/zigglgen.tar.gz",
11-
.hash = "122059d1ff6787eedb40771eabb0f04d04fe299bd1bae7b216c4a9d894719c2a148a",
10+
.url = "https://github.com/castholm/zigglgen/releases/download/v0.2.2/zigglgen.tar.gz",
11+
.hash = "1220b0b1d61dfe8a244a3928b20cfa596e252656cca90120c26661898986ce3d1f82",
1212
},
1313
},
1414
.paths = .{

zigglgen-example/gles3.zig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Bindings for OpenGL ES 3.0 generated by zigglgen.
22

3-
// OpenGL XML API Registry revision: 3530768138c5ba3dfbb2c43c830493f632f7ea33
4-
// zigglgen version: 0.2.1
3+
// OpenGL XML API Registry revision: 4265ce1a6e40abdab98f5f2e11365b59f5ef04bc
4+
// zigglgen version: 0.2.2
55

66
// Example usage:
77
//
@@ -1765,7 +1765,7 @@ pub const ProcTable = struct {
17651765
switch (@typeInfo(field_info.type)) {
17661766
.Pointer => |ptr_info| switch (@typeInfo(ptr_info.child)) {
17671767
.Fn => {
1768-
success &= @intFromBool(procs.initCommand(loader, field_info.name ++ ""));
1768+
success &= @intFromBool(procs.initCommand(loader, field_info.name));
17691769
},
17701770
else => comptime unreachable,
17711771
},
@@ -1818,7 +1818,7 @@ pub const ProcTable = struct {
18181818

18191819
fn initExtension(procs: *ProcTable, comptime name: [:0]const u8) bool {
18201820
var count: c_int = 0;
1821-
procs.GetIntegerv(NUM_EXTENSIONS, @ptrCast(&count));
1821+
procs.GetIntegerv(NUM_EXTENSIONS, (&count)[0..1]);
18221822
if (count < 0) return false;
18231823
var i: c_uint = 0;
18241824
while (i < @as(c_uint, @intCast(count))) : (i += 1) {

zigglgen/api_registry.zig

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// This file was generated by 'updateApiRegistry.ps1'.
2-
// OpenGL XML API Registry revision: 3530768138c5ba3dfbb2c43c830493f632f7ea33
2+
// OpenGL XML API Registry revision: 4265ce1a6e40abdab98f5f2e11365b59f5ef04bc
33

4-
pub const revision = "3530768138c5ba3dfbb2c43c830493f632f7ea33";
4+
pub const revision = "4265ce1a6e40abdab98f5f2e11365b59f5ef04bc";
55

66
pub const Type = struct {
77
name: Name,
@@ -5072,6 +5072,7 @@ pub const Constant = struct {
50725072
TEXTURE_BUFFER_SIZE,
50735073
TEXTURE_BUFFER_SIZE_EXT,
50745074
TEXTURE_BUFFER_SIZE_OES,
5075+
TEXTURE_CBCR_DEGAMMA_QCOM,
50755076
TEXTURE_CLIPMAP_CENTER_SGIX,
50765077
TEXTURE_CLIPMAP_DEPTH_SGIX,
50775078
TEXTURE_CLIPMAP_FRAME_SGIX,
@@ -5330,6 +5331,7 @@ pub const Constant = struct {
53305331
TEXTURE_WRAP_R_OES,
53315332
TEXTURE_WRAP_S,
53325333
TEXTURE_WRAP_T,
5334+
TEXTURE_Y_DEGAMMA_QCOM,
53335335
TEXTURE0,
53345336
TEXTURE0_ARB,
53355337
TEXTURE1,
@@ -7870,6 +7872,7 @@ pub const Command = struct {
78707872
NamedFramebufferTextureFaceEXT,
78717873
NamedFramebufferTextureLayer,
78727874
NamedFramebufferTextureLayerEXT,
7875+
NamedFramebufferTextureMultiviewOVR,
78737876
NamedProgramLocalParameter4dEXT,
78747877
NamedProgramLocalParameter4dvEXT,
78757878
NamedProgramLocalParameter4fEXT,
@@ -15315,6 +15318,7 @@ pub const constants = [_]Constant{
1531515318
.{ .name = .TEXTURE_BUFFER_SIZE, .value = 37278 },
1531615319
.{ .name = .TEXTURE_BUFFER_SIZE_EXT, .value = 37278 },
1531715320
.{ .name = .TEXTURE_BUFFER_SIZE_OES, .value = 37278 },
15321+
.{ .name = .TEXTURE_CBCR_DEGAMMA_QCOM, .value = 38673 },
1531815322
.{ .name = .TEXTURE_CLIPMAP_CENTER_SGIX, .value = 33137 },
1531915323
.{ .name = .TEXTURE_CLIPMAP_DEPTH_SGIX, .value = 33142 },
1532015324
.{ .name = .TEXTURE_CLIPMAP_FRAME_SGIX, .value = 33138 },
@@ -15573,6 +15577,7 @@ pub const constants = [_]Constant{
1557315577
.{ .name = .TEXTURE_WRAP_R_OES, .value = 32882 },
1557415578
.{ .name = .TEXTURE_WRAP_S, .value = 10242 },
1557515579
.{ .name = .TEXTURE_WRAP_T, .value = 10243 },
15580+
.{ .name = .TEXTURE_Y_DEGAMMA_QCOM, .value = 38672 },
1557615581
.{ .name = .TEXTURE0, .value = 33984 },
1557715582
.{ .name = .TEXTURE0_ARB, .value = 33984 },
1557815583
.{ .name = .TEXTURE1, .value = 33985 },
@@ -33124,6 +33129,18 @@ pub const commands = [_]Command{
3312433129
},
3312533130
.return_type_expr = &.{.void},
3312633131
},
33132+
.{
33133+
.name = .NamedFramebufferTextureMultiviewOVR,
33134+
.params = &.{
33135+
.{ .name = "framebuffer", .type_expr = &.{.{ .type = .uint }} },
33136+
.{ .name = "attachment", .type_expr = &.{.{ .type = .@"enum" }} },
33137+
.{ .name = "texture", .type_expr = &.{.{ .type = .uint }} },
33138+
.{ .name = "level", .type_expr = &.{.{ .type = .int }} },
33139+
.{ .name = "baseViewIndex", .type_expr = &.{.{ .type = .int }} },
33140+
.{ .name = "numViews", .type_expr = &.{.{ .type = .sizei }} },
33141+
},
33142+
.return_type_expr = &.{.void},
33143+
},
3312733144
.{
3312833145
.name = .NamedProgramLocalParameter4dEXT,
3312933146
.params = &.{
@@ -65104,6 +65121,7 @@ pub const extensions = [_]Extension{
6510465121
.{ .name = .{ .constant = .MAX_VIEWS_OVR } },
6510565122
.{ .name = .{ .constant = .FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR } },
6510665123
.{ .name = .{ .command = .FramebufferTextureMultiviewOVR } },
65124+
.{ .name = .{ .command = .NamedFramebufferTextureMultiviewOVR } },
6510765125
},
6510865126
},
6510965127
.{

zigglgen/build.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ pub fn generateBindingsSourceFile(b: *std.Build, options: GeneratorOptions) std.
4747
return output;
4848
}
4949

50+
// TODO 2024.5.0-mach: Replace with 'b.dependencyFromBuildZig'.
5051
fn thisDependency(b: *std.Build, args: anytype) *std.Build.Dependency {
5152
find_dep: {
5253
const all_pkgs = @import("root").dependencies.packages;

zigglgen/build.zig.zon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.{
22
.name = "zigglgen",
3-
.version = "0.2.1",
3+
.version = "0.2.2",
44
.minimum_zig_version = "0.12.0-dev",
55
.paths = .{
66
"LICENSE.md",

zigglgen/generator.zig

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ fn renderCode(
402402
\\//! Bindings for {[api_pretty]s} {[version_major]d}.{[version_minor]d}{[sp_profile_pretty]s} generated by zigglgen.
403403
\\
404404
\\// OpenGL XML API Registry revision: {[registry_revision]s}
405-
\\// zigglgen version: 0.2.1
405+
\\// zigglgen version: 0.2.2
406406
\\
407407
\\// Example usage:
408408
\\//
@@ -626,9 +626,7 @@ fn renderCode(
626626
\\ switch (@typeInfo(field_info.type)) {
627627
\\ .Pointer => |ptr_info| switch (@typeInfo(ptr_info.child)) {
628628
\\ .Fn => {
629-
// TODO 2024.3.0-mach
630-
//\\ success &= @intFromBool(procs.initCommand(loader, field_info.name));
631-
\\ success &= @intFromBool(procs.initCommand(loader, field_info.name ++ ""));
629+
\\ success &= @intFromBool(procs.initCommand(loader, field_info.name));
632630
\\ },
633631
\\ else => comptime unreachable,
634632
\\ },
@@ -734,9 +732,7 @@ fn renderCode(
734732
// under the Core profile.
735733
try writer.writeAll(
736734
\\ var count: c_int = 0;
737-
// TODO 2024.3.0-mach
738-
//\\ procs.GetIntegerv(NUM_EXTENSIONS, (&count)[0..1]);
739-
\\ procs.GetIntegerv(NUM_EXTENSIONS, @ptrCast(&count));
735+
\\ procs.GetIntegerv(NUM_EXTENSIONS, (&count)[0..1]);
740736
\\ if (count < 0) return false;
741737
\\ var i: c_uint = 0;
742738
\\ while (i < @as(c_uint, @intCast(count))) : (i += 1) {
@@ -795,6 +791,7 @@ fn renderCode(
795791
);
796792
}
797793

794+
// TODO 2024.5.0-mach: Remove 'formatDeclId' and audit uses of 'fmtId'.
798795
const fmtId = std.zig.fmtId;
799796

800797
fn fmtDeclId(bytes: []const u8) std.fmt.Formatter(formatDeclId) {

zigglgen/generator_options.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file was generated by 'updateApiRegistry.ps1'.
2-
// OpenGL XML API Registry revision: 3530768138c5ba3dfbb2c43c830493f632f7ea33
2+
// OpenGL XML API Registry revision: 4265ce1a6e40abdab98f5f2e11365b59f5ef04bc
33

44
pub const Api = enum { gl, gles, glsc };
55

0 commit comments

Comments
 (0)