You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Zig has non-exhaustive enums, which can let us wrap the basic GLsizei type that is used for resource identifiers such as buffers, textures, shaders, etc, and help users avoid passing the wrong ID to the appropriate function. Then the relevant resource bindings would take the enum types instead of raw integers to give better hints as to how they're supposed to be used - these would decompose into the underlying raw integer type transparently inside the binding when calling the actual GLES function. For example:
This idea has a lot of value with functions like framebufferTexture2D that take a lot of integer parameters, making it easy to accidentally pass the wrong type.
Thanks to Andrew for this idea.
The text was updated successfully, but these errors were encountered:
Zig has non-exhaustive enums, which can let us wrap the basic
GLsizei
type that is used for resource identifiers such as buffers, textures, shaders, etc, and help users avoid passing the wrong ID to the appropriate function. Then the relevant resource bindings would take the enum types instead of raw integers to give better hints as to how they're supposed to be used - these would decompose into the underlying raw integer type transparently inside the binding when calling the actual GLES function. For example:This idea has a lot of value with functions like
framebufferTexture2D
that take a lot of integer parameters, making it easy to accidentally pass the wrong type.Thanks to Andrew for this idea.
The text was updated successfully, but these errors were encountered: