Skip to content

Conversation

@LukaTD
Copy link
Contributor

@LukaTD LukaTD commented Nov 18, 2025

Additional changes:

  • enum parameter used by blendEquationSeparate is now also used by blendEquation in OpenGL 1.4,
  • extracted enum parameter used by getProgramiv to its own type,
  • adjusted uniformMatrix4fv to be consistent with other functions like it.

other notable changes:
* enum parameter used by `blendEquationSeparate` is now also used by `blendEquation` in OpenGL 1.4,
* extracted enum parameter used by `getProgramiv` to its own type,
* adjusted `uniformMatrix4fv` to be consistent with other functions like it.
@hazeycode hazeycode requested a review from Copilot November 19, 2025 00:18
Copilot finished reviewing on behalf of hazeycode November 19, 2025 00:21
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds comprehensive wrapper functions for OpenGL 2.0 and 2.1, significantly expanding the API coverage. The changes include new enum types for better type safety and consistency across the wrapper API.

  • Introduces 6 new enum types (ColorBufferSingle, BlendEquation, ProgramParameter, AttribType, UniformType, VertexAttribParameter, VertexAttribPointerParameter)
  • Refactors existing functions to use new enum types for improved type safety
  • Adds 80+ OpenGL 2.0 wrapper functions including shader/program management, vertex attributes, and uniform operations
  • Adds 6 OpenGL 2.1 wrapper functions for non-square matrix uniforms

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@intFromEnum(face),
@intFromEnum(func),
@as(Int, @bitCast(ref)),
@as(Uint, @bitCast(mask)),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The @ass should be redundant, the result type is inferred from the arg type of the procedure we're passing to.

Copy link
Member

@hazeycode hazeycode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!
Looks good to me other than the picky nitpick about redundant @as usage.

@hazeycode hazeycode merged commit 5701e0f into zig-gamedev:main Nov 19, 2025
3 checks passed
@LukaTD
Copy link
Contributor Author

LukaTD commented Nov 19, 2025

Sure, I can omit @as in the future. I used it because already defined wrapper functions used it. I would say it helps with deducing types(since bindings is anytype), after the comment with definition from bindings.zig is removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants