opengl
I ran into some issues getting a sample OpenGL application with GLFW working with Zig on Windows, so I figured I’d write a short post outlining what’s needed to get it working.
Build GLFW Download GLFW and build it from source. The pre-built windows static libraries available for download are compiled with a flag that is incompatible with the way Zig builds libraries. I discovered this by opening an issue on the Zig repo.
I’ve been chipping away at the OpenGL tutorials, today I implemented (and actually understood every aspect of) a rotating cube with a reflection in the floor. It involves the depth buffer, stencil buffer, depth-testing and stencil-testing. I could record a video, convert it to gif and put it here, but I’m lazy so I’ll just post a screenshot instead:
I started playing around with Horde3d a while back. I even made my own fork of it and messed about a bit with it. But then I realized that I don’t actually have any idea about how it renders stuff internally, and the whole point of picking it over an existing engine was so that I could modify its innards whenever I pleased. So, I decided to sit down and properly learn OpenGL.