Karma Engine
Loading...
Searching...
No Matches
OpenGLShader.h
1#pragma once
2
3#include "krpch.h"
4
5#include "Karma/Renderer/Shader.h"
6#include "glad/glad.h"
7#include "Karma/KarmaUtilities.h"
8
9namespace Karma
10{
11 struct OpenGLUniformBuffer;
12 class KARMA_API OpenGLShader : public Shader
13 {
14 public:
15 OpenGLShader(const std::string& vertexSrc, const std::string& fragmentSrc);
16 OpenGLShader(const std::string& vertexSrcFile, const std::string& fragmentSrcFile, std::shared_ptr<UniformBufferObject> ubo, bool bIsFile,
17 const std::string& shaderName);
18 virtual ~OpenGLShader() override;
19
20 virtual void Bind() const override;
21 virtual void Bind(const std::string& texShaderNames) const override;
22 virtual void UnBind() const override;
23
24 void UploadUniformMat4(const std::string& name, const glm::mat4& matrix);
25
26 private:
27 void Compile(const std::unordered_map<GLenum, std::string>& shaderSources);
28
29 private:
30 // OpenGL's identification scheme
31 uint32_t m_RendererID;
32 std::shared_ptr<OpenGLUniformBuffer> m_UniformBufferObject;
33 };
34}
Definition OpenGLShader.h:13
Definition Shader.h:11