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
Note that in the native API, you could pass any integer, where with this system you could only pass valid parameters. This gets a lot of value when dealing with more complicated functions:
For variable-sized values such as fn glActiveTexture(texture: GLenum) void, which takes GL_TEXTUREi to GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS - 1 values, these can still be generated for the user at comptime into a bounded typesafe enum.
The text was updated successfully, but these errors were encountered:
OpenGL/ES defines a large number of values that have virtually no type safety - you can often pass completely unrelated values such as:
GL_BUFFER_USAGE
GL_DEPTH_FUNC
GL_VIEWPORT
to parameters that take an unsigned integer, and get no type checking to help you fail faster. A straightforward example would be:
Note that in the native API, you could pass any integer, where with this system you could only pass valid parameters. This gets a lot of value when dealing with more complicated functions:
For variable-sized values such as
fn glActiveTexture(texture: GLenum) void
, which takesGL_TEXTUREi
toGL_MAX_COMBINED_TEXTURE_IMAGE_UNITS - 1
values, these can still be generated for the user at comptime into a bounded typesafe enum.The text was updated successfully, but these errors were encountered: