aboutsummaryrefslogtreecommitdiff
path: root/include/RenderBackend/OpenGL/VertexShader.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/RenderBackend/OpenGL/VertexShader.hpp')
-rw-r--r--include/RenderBackend/OpenGL/VertexShader.hpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/RenderBackend/OpenGL/VertexShader.hpp b/include/RenderBackend/OpenGL/VertexShader.hpp
index 3239be2..43a5dd8 100644
--- a/include/RenderBackend/OpenGL/VertexShader.hpp
+++ b/include/RenderBackend/OpenGL/VertexShader.hpp
@@ -1,6 +1,8 @@
#pragma once
#include "../../DataView.hpp"
+#include "../../utils.hpp"
+#include "../../Result.hpp"
#include "ShaderVec.hpp"
#include <string>
#include <unordered_map>
@@ -40,18 +42,23 @@ namespace amalgine
* Using the same VertexShader instance in multiple threads to define data is not thread safe.
* All get*** functions are thread safe.
*/
+ class CompiledVertexShader;
+
class VertexShader
{
+ DISABLE_COPY(VertexShader)
+ friend class ShaderProgram;
public:
VertexShader();
const std::string& getInputAttributeName(i32 attributeIndex);
ShaderInputVec2 defineInputVec2(const std::string &name);
void defineMain(VertexShaderMainFunc mainFunc);
- std::string build() const;
+ Result<CompiledVertexShader*> compile();
private:
void writeHeader(const std::string &code);
void writeBody(const std::string &code);
+ std::string build() const;
/*
* Throws VertexShaderTooManyInputAttributes if too many vertex attributes are defined for the platform.