Basically, my goal is to make it a Nim compile error if anything would cause your OpenGL code not to work.
Then my wife had a baby and things got busy. Fast forward a year and I'm picking it back up. But I decided I needed some feedback. While I've been in the industry for many years, I'm not really an expert in graphics programming -- which makes me a bad judge of whether this is actually headed in the right direction. So I suppose I'm interested in getting some constructive feedback.
The code: https://github.com/Nycto/safegl-nim
Docs: https://nycto.github.io/safegl-nim/safegl.html
And an example: https://github.com/Nycto/safegl-nim/blob/master/example/src/example.nim
Looks nice!
I believe this package has similar goals, not sure if you have come across it before: https://github.com/jackmott/easygl
I remember looking at that. It’s still a bit more low level than I would like. For example, you still need to manually cram OpenGL types into boilerplate function calls:
https://github.com/jackmott/easygl/blob/master/examples/getting_started/shaderstut.nim#L41
That kind of stuff can be generated automatically by integrating with Nim’s type system via macros:
https://github.com/Nycto/safegl-nim/blob/master/src/safegl/vertex.nim#L39