glad icon indicating copy to clipboard operation
glad copied to clipboard

Zig Generator

Open s5bug opened this issue 3 years ago • 1 comments

I tried to work on a Zig generator myself, but wasn't able to make sense of the Python code.

I would hope for something like https://github.com/Iridescence-Technologies/zglfw/blob/master/src/glfw.zig, which returns errors and such explicitly, but also something like https://github.com/Snektron/vulkan-zig or https://github.com/ziglibs/zgl with the concise naming and more proper typing.

I would implement it myself except for my previously mentioned inability to easily understand Python. I'm more than happy to help if syntax help is required.

The C code should be nearly directly translatable, except:

  1. the gl or GL_ preceding things can be dropped, as seen in vulkan-zig
  2. there are things that would make more sense as "instance methods" like in zgl (and I think vulkan-zig does this fully automatically?)

I'm thinking about https://github.com/ziglibs/zlm as well, being designed specifically to work with OpenGL, if a link to it is any helpful.

s5bug avatar Jan 03 '21 01:01 s5bug

I followed what GLAD's C source code looked like and manually crafted https://github.com/s5bug/zglt/blob/master/src/zglt.zig: I'm hoping that something like this is simple enough for GLAD to generate? My naming for a few things might be a little off, but I hope what I've written is understandable.

s5bug avatar Jan 03 '21 20:01 s5bug

I closed the PR, I will integrate plugins into the web generator but I cannot maintain more languages

Dav1dde avatar Oct 21 '22 16:10 Dav1dde

👍 I don't use Zig anymore, but I'll leave my changes up in case someone in the future can make use of them.

s5bug avatar Oct 22 '22 02:10 s5bug