-
Notifications
You must be signed in to change notification settings - Fork 15
Adjusted bindings to match OpenGL-Registry(/api/GL/glcorearb.h) more closely #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…closely * converted non-void pointers to '[*c]' (C pointers) * converted void pointers to '?*anyopaque' * converted non-GL types to GL types * added 'const' where needed * adjusted argument names to match those in the registry
* makes it possible to unset the debug callback, by passing in 'null'
There was a problem hiding this 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 standardizes pointer type declarations in OpenGL bindings for Zig, converting from inconsistent pointer types to the more appropriate [*c] (C pointer) convention and nullable optionals where appropriate.
Key changes include:
- Converting single-item pointers (
*const Type) to C pointers ([*c]const Type) for consistency with C FFI - Converting bare pointer types to nullable optionals (
?*const anyopaque) where nullability is semantically valid - Renaming parameters to match OpenGL specification conventions (e.g.,
binary_formattobinaryFormat,shader_typetoshadertype) - Removing unnecessary
@"type"escaping in parameter names
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
hazeycode
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
`bindings.zig` changes: * used literals instead of variables for enums in OpenGL 4.2, * moved `DEBUGPROC` to the beginning of OpenGL 4.3, * adjusted wrong enum name from `VIEW_CLASS_RGTC1_RG` to `VIEW_CLASS_RGTC2_RG` in OpenGL 4.3, * added missing enums to OpenGL 4.4, * removed enum `TEXTURE_BINDING` from OpenGL 4.5, * changed ARB enums to non-ARB ones in OpenGL 4.5, * added missing enums to OpenGL 4.5, * added `POLYGON_OFFSET_CLAMP` to OpenGL 4.6, * added spacing between sections. `wrapper.zig` changes: * added changes from merge zig-gamedev#25 to wrapper placeholders, * applied enum changes done in `bindings.zig`, * moved `DEBUGPROC` to the beginning of OpenGL 4.3, * added many missing enums to OpenGL 4.3, * added missing function placeholders to OpenGL 4.3, * added missing function placeholders to OpenGL 4.5, * return type of `getGraphicsResetStatus` uses non-ARB enums in OpenGL 4.5, * added spacing between sections.
`bindings.zig` changes: * used literals instead of variables for enums in OpenGL 4.2, * moved `DEBUGPROC` to the beginning of OpenGL 4.3, * adjusted wrong enum name from `VIEW_CLASS_RGTC1_RG` to `VIEW_CLASS_RGTC2_RG` in OpenGL 4.3, * added missing enums to OpenGL 4.4, * removed enum `TEXTURE_BINDING` from OpenGL 4.5, * changed ARB enums to non-ARB ones in OpenGL 4.5, * added missing enums to OpenGL 4.5, * added `POLYGON_OFFSET_CLAMP` to OpenGL 4.6, * added spacing between sections. `wrapper.zig` changes: * added changes from merge #25 to wrapper placeholders, * applied enum changes done in `bindings.zig`, * moved `DEBUGPROC` to the beginning of OpenGL 4.3, * added many missing enums to OpenGL 4.3, * added missing function placeholders to OpenGL 4.3, * added missing function placeholders to OpenGL 4.5, * return type of `getGraphicsResetStatus` uses non-ARB enums in OpenGL 4.5, * added spacing between sections.
General adjustments:
[*c](C pointers),?*anyopaque,constwhere needed,Additional specific changes:
paramsargument forgetPointervandgetPointervKHR(void*->void**),callbackargument ofdebugMessageCallbackanddebugMessageCallbackKHRoptional, so debug callback can be unset by passingnull.