Fireball library and generator for OpenGL.
- Generates instance-based
Apistruct instead of global state. - Parses enums into strongly typed, distinct enums instead of untyped integers (
GL_VERTEX_SHADER->ShaderType::VertexShader). - Function names have the
glprefix stripped and are converted to snake case (glCreateBuffers->create_buffers). - Dynamically queries the version + extensions (
KHR,ARBandEXT) and fallbacks to a panic stub.
func get_gl_address(name: StringView) *void {
// `glfw_get_proc_address()` or `SDL_GL_GetProcAddress()` for example
}
func main() {
// window / context init
var gl = opengl::Api::load(get_gl_address).unwrap();
var buffer: u32;
gl.create_buffers(1, &buffer);
}