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
Should the user be expected to use the GL types as defined in bindings.zig, or should be standard Zig & the types defined in the wrapper?
The wrapper "forwards" types defined by the bindings. A wrapper user shouldn't need to access any definitions from bindings.zig directly.
Some enums (for example, the debug output filter) have an element which may be present but would only be provided to one function but not the rest (e.g. GL_DONT_CARE) should these be part of the enum, defined in-line, part of some extended enum, or from time-to-time allowing a null value to define this extra behaviour?
Ideally functions should only take enums sets where all the members are valid for that function. Note that for some functions enum types are defined inline. And there are probably some mistakes present currently. From the opposite angle wrapper.meta.mergeEnums can be used to merge enum sets.
When data is going to and from OpenGL, what type should generally be preferred? A pointer + offset, or a []u8? This is mostly a fluency question. Textures currently use opaque pointers, while buffers use arrays. Consistency would be nice to have.
Slices should be preferred to pointer+len unless that prevents some functionality. For example glBufferData can be passed a size and a nullptr to allocate memory of size but not write to it.
Getter functions such as getProgramiv seem to generally return their result by value, while creation functions return by reference (in particular, the single-value overrides). For fluency sake, would it make more sense to have both return by value?
The current convention is that gen* procs return by reference and create* procs return by value. For get* procs I'm not sure what is best, there is an argument for both.
If zopengl is just a wrapper then dont overcomplicate the api, keep it 1:1. Thousands of tutorials use whatever glThisAndThat function with a specific list of parameters according to the glspec. It wouldn't help the uninitiated OpenGL beginner to be confronted with such things. my 2cents
zopengl.bindings offers a 1:1 API. zopengl.wrapper is intended to add a little bit of type safety and better auto-complete to prevent silly mistakes. But I agree that we should be conservative and ensure any deviations are +EV for the user.
OpenGL has too many quirks unfortunately. I would let the consumer of the bindings decide how and if they want to wrap it somehow to make it more tolerable. But let's see what the other frogs have to say.
While I wholeheartedly agree and have used the same argument in the past, I believe in the value of fluency that the wrapper layer offers. It's what drew me to zopengl over other alternatives after all.
The goal should be a paper thin wrapper, not a comprehensive abstraction. And I'm certain that some compromises would have to be made to allow leeway for the 'quirks' of the API.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.
Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.
🎥 Watch TMZ Live
TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.
Uh oh!
There was an error while loading. Please reload this page.
-
Pasteing discussion from Discord to start the discussion here...
The wrapper "forwards" types defined by the bindings. A wrapper user shouldn't need to access any definitions from bindings.zig directly.
Ideally functions should only take enums sets where all the members are valid for that function. Note that for some functions enum types are defined inline. And there are probably some mistakes present currently. From the opposite angle wrapper.meta.mergeEnums can be used to merge enum sets.
Slices should be preferred to pointer+len unless that prevents some functionality. For example glBufferData can be passed a size and a nullptr to allocate memory of size but not write to it.
The current convention is that gen* procs return by reference and create* procs return by value. For get* procs I'm not sure what is best, there is an argument for both.
Beta Was this translation helpful? Give feedback.
All reactions