Implemented ShaderProgramBuilder

This commit is contained in:
2025-07-27 16:13:48 -04:00
parent 94c9216225
commit 370196ef7a
6 changed files with 135 additions and 35 deletions

View File

@@ -0,0 +1,28 @@
#pragma once
#include <stdexcept>
#include <GL/glew.h>
namespace ugly{
class ShaderProgramBuilder {
public:
class Error: public std::runtime_error{
public:
using std::runtime_error::runtime_error;
};
public:
ShaderProgramBuilder();
~ShaderProgramBuilder();
void reset();
ShaderProgramBuilder &attachFromMemory(GLenum type, const GLchar *string, GLint length = 0);
ShaderProgramBuilder &attachFromFile(GLenum type, const char *filename);
GLuint link();
private:
GLuint mProgram;
};
}