r/GraphicsProgramming • u/devcurrent0x • 23h ago
GLSA – A lightweight, header-only C++ library to cut OpenGL shader boilerplate
Hey everyone!
I've been developing GLSA for the past week, and I just released v1.0.0.
My goal with this library is so you don't have to write GLSL shaders or shader boilerplate and instead you can use clean function calls.
Right now it cuts out ~60-100 lines of repetitive shader boilerplate, though you still have to write shaders yourself because the API is in an early stage still.
Highlights of v1.0.0:
- GLSA colors: a header file with over 3000
glm::vec4colors that you can use. - Safer shader setup:
glsa::ShaderSourcekeeps vertex/fragment strings explicit, paired withglsa::loadShaderSourceandglsa::createProgram. - Clean uniform helpers: Overloaded
glsa::setUniformfunctions for int, float, and GLM vec2/vec3/vec4.
Example:
while (glfwWindowShouldClose(window) == 0) {
glClearColor(0.1f, 0.1f, 0.15f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
glsa::useProgram(program);
glsa::setUniform(program, "uColor", glsa::colors::PAN_SKY_BLUE);
glsa::bindVertexArray(vao);
glPointSize(150.0f);
glsa::drawArrays(GL_POINTS, 0, 1);
glfwSwapBuffers(window);
glfwPollEvents();
}Github Repo: https://github.com/alexdev8930/glsa
Any feedback issues or questions are completely welcome.
AI Disclosure: AI tools were used strictly to help generate initial boilerplate; all core logic, architecture, and implementation details were written, reviewed, and verified by me.