Karma Engine
Loading...
Searching...
No Matches
Shader.h
1#pragma once
2
3#include "krpch.h"
4
5#include "Karma/Renderer/Buffer.h"
6#include "glm/glm.hpp"
7
8namespace Karma
9{
10 class KARMA_API Shader
11 {
12 public:
13 Shader(std::shared_ptr<UniformBufferObject> ubo) : m_UniformBufferObject(ubo)
14 {}
15 virtual ~Shader() = default;
16
17 virtual void Bind() const {}
18 virtual void Bind(const std::string& texShaderNames) const {}
19 virtual void UnBind() const {}
20
21 virtual void GenerateUniformBufferObject() {}
22 virtual void BindUniformBufferObject() {}
23 std::shared_ptr<UniformBufferObject> GetUniformBufferObject() const { return m_UniformBufferObject; }
24
25 static Shader* Create(const std::string& vertexSrc, const std::string& fragmentSrc);
26 static Shader* Create(const std::string& vertexSrcFile, const std::string& fragmentSrcFile, std::shared_ptr<UniformBufferObject> ubo,
27 bool bIsFile, const std::string& shaderName = "NoNamedShader");
28
29 // Getters
30 const std::string& GetShaderName() const { return m_ShaderName; }
31
32 private:
33 std::shared_ptr<UniformBufferObject> m_UniformBufferObject;
34
35 protected:
36 std::string m_ShaderName;
37 };
38}
Definition Shader.h:11