diff options
author | dec05eba <dec05eba@protonmail.com> | 2017-12-21 22:52:12 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-11-18 15:21:48 +0100 |
commit | bfd21732b35a3856b1f72c826816c2857710fcb3 (patch) | |
tree | 4a3f19551c744db3e339a64ac1afa2ebe1ec015f /include/RenderBackend/OpenGL/ShaderProgram.hpp | |
parent | ca92d8c90f7103db6d7cae4cef49b278d804b474 (diff) |
Added shader program
Diffstat (limited to 'include/RenderBackend/OpenGL/ShaderProgram.hpp')
-rw-r--r-- | include/RenderBackend/OpenGL/ShaderProgram.hpp | 34 |
1 files changed, 34 insertions, 0 deletions
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 <vector> + +namespace amalgine +{ + class ShaderProgram + { + public: + ShaderProgram(); + + const std::string& getOutputAttributeName(i32 attributeIndex); + ShaderOutputVec4 defineOutputVec4(const std::string &name); + //Result<std::string> addVertexShader(const VertexShader &vertexShader); + //Result<std::string> 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<std::string, i32> pixelAttributes; + std::vector<std::string> pixelAttributeNames; + std::vector<u32> shaderIds; + }; +} |