aboutsummaryrefslogtreecommitdiff
path: root/include/RenderBackend/OpenGL/ShaderFrame.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/RenderBackend/OpenGL/ShaderFrame.hpp')
-rw-r--r--include/RenderBackend/OpenGL/ShaderFrame.hpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/include/RenderBackend/OpenGL/ShaderFrame.hpp b/include/RenderBackend/OpenGL/ShaderFrame.hpp
new file mode 100644
index 0000000..da0918e
--- /dev/null
+++ b/include/RenderBackend/OpenGL/ShaderFrame.hpp
@@ -0,0 +1,35 @@
+#pragma once
+
+#include "../../Result.hpp"
+#include "../../types.hpp"
+#include "../../utils.hpp"
+#include "Uniform.hpp"
+#include "DeviceMemory.hpp"
+
+#include <map>
+#include <memory>
+#include <string>
+
+namespace amalgine {
+ class ShaderFrame {
+ DISABLE_COPY(ShaderFrame)
+ friend class ShaderProgram;
+ public:
+ ~ShaderFrame();
+ ShaderFrame(ShaderFrame &&other) = default;
+ ShaderFrame& operator=(ShaderFrame &&other) = default;
+
+ DeviceMemory* get_input_by_name(const char *name);
+ Result<Uniform> get_uniform_by_name(const char *name);
+
+ void draw();
+ private:
+ ShaderFrame(u32 shader_program_id);
+ private:
+ u32 shader_program_id;
+ u32 vertex_array_object_id;
+
+ // TODO: Use a const char* as a key instead
+ std::map<std::string, std::unique_ptr<DeviceMemory>> shader_inputs;
+ };
+}