#pragma once #include "../../Result.hpp" #include "../../types.hpp" #include "../../utils.hpp" #include #include namespace amalgine { class CompiledVertexShader; class CompiledPixelShader; class ShaderProgramUsedBeforeBuilt : public std::runtime_error { public: // TODO: Add name to ShaderProgram so we know which shader has issue when // an exception is thrown? ShaderProgramUsedBeforeBuilt(); }; class ShaderProgram { DISABLE_COPY(ShaderProgram) public: ShaderProgram(); ~ShaderProgram(); bool setVertexShader(CompiledVertexShader *vertexShader); bool setPixelShader(CompiledPixelShader *pixelShader); Result build(); void use(); private: u32 shaderProgramId; bool built; }; }