Low-level graphics API that supports multiple multiple back-ends (Vulkan, OpenGL, WebGPU, etc), with an emphasis on being dead simple to setup and use.
Only support the most-common shader setups:
- Drawing colored geometry
- Textured geometry / images
- Colored text and icons (I.e 1 Channel images with color assigned per mapping)
Additionally, you could specify some basic options:
- Z-culling (Whether to include z coordinate in vertices and setup a depth buffer)
- Desired Anti-aliasing level
- Image blitting (scaling) method
NOTE: This could all be turned on and off at compile time and runtime.
Example: You enable generation of anti-aliasing code, but allow the user to toggle it on and off at runtime.
Example: You disable generating code for textured geometry, because you know you'll only need text / icons + colored geometry
Why write instead of using a pre-existing library?
-
This should be a super simple, low effort library, and having something written in Zig would reduce friction of getting something compiled and running.
I believe both Odin and Jai have simple to use graphics APIs in this spirit -
I think comptime would absolutely shine here. As described above, you could omit generating code for certain features and generate quite efficient code.
As such it could be used for writing high-quality, efficient applications, albeit ones that have simple requirements in regards to graphics.
If enough people are interested I could actually write this myself (At least with an initial Vulkan back-end), because I'm currently working on the renderer in Reel anyways to create a dedicated draw pass for icons / text. It wouldn't be a tonne of extra work to extract it into a standalone library.