From bfd21732b35a3856b1f72c826816c2857710fcb3 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 21 Dec 2017 22:52:12 +0100 Subject: Added shader program --- include/RenderBackend/OpenGL/ShaderProgram.hpp | 34 ++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 include/RenderBackend/OpenGL/ShaderProgram.hpp (limited to 'include/RenderBackend/OpenGL/ShaderProgram.hpp') diff --git a/include/RenderBackend/OpenGL/ShaderProgram.hpp b/include/RenderBackend/OpenGL/ShaderProgram.hpp new file mode 100644 index 0000000..efeae5b --- /dev/null +++ b/include/RenderBackend/OpenGL/ShaderProgram.hpp @@ -0,0 +1,34 @@ +#pragma once + +#include "VertexShader.hpp" +#include "PixelShader.hpp" +#include "../../Result.hpp" +#include "../../types.hpp" +#include + +namespace amalgine +{ + class ShaderProgram + { + public: + ShaderProgram(); + + const std::string& getOutputAttributeName(i32 attributeIndex); + ShaderOutputVec4 defineOutputVec4(const std::string &name); + //Result addVertexShader(const VertexShader &vertexShader); + //Result addPixelShader(const PixelShader &pixelShader); + //void build(); + private: + /* + * Throws PixelShaderTooManyAttributes if too many pixel attributes are defined for the platform. + * Throws PixelShaderAttributeAlreadyDefined if a pixel attribute with the same name has already been defined. + */ + i32 defineOutputVariable(const std::string &variableName, const char *typeName); + private: + int locationCounter; + i32 maxPixelAttribs; // Could make this static + std::unordered_map pixelAttributes; + std::vector pixelAttributeNames; + std::vector shaderIds; + }; +} -- cgit v1.2.3