KarmaEngine
Game Engine for practical learning and research purposes
Loading...
Searching...
No Matches
Shader.h
Go to the documentation of this file.
1
10#pragma once
11
13#include "glm/glm.hpp"
14
15namespace Karma
16{
21 {
22 public:
30 {}
31
37 virtual ~Shader() = default;
38
45 virtual void Bind() const {}
46
53 virtual void Bind(const std::string& texShaderNames) const {}
54
61 virtual void UnBind() const {}
62
69 static Shader* Create(const std::string& vertexSrc, const std::string& fragmentSrc);
70
80 static Shader* Create(const std::string& vertexSrcFile, const std::string& fragmentSrcFile, const std::string& shaderName = "NoNamedShader");
81
82 // Getters
89 const std::string& GetShaderName() const { return m_ShaderName; }
90
91 protected:
92 std::string m_ShaderName;
93 };
94}
This file contains base classes for various kinds of buffers used by the Engine.
#define KARMA_API
Defining Karma's API macro for storage class information.
Definition Core.h:41
Base class of vertex + fragment shaders (for Vulkan and OpenGL).
Definition Shader.h:21
const std::string & GetShaderName() const
Getter for shader name.
Definition Shader.h:89
virtual void Bind() const
Installs a shader (vertex + fragment) and uniform program object as part of current rendering state.
Definition Shader.h:45
virtual void UnBind() const
Undo the binding of shader program.
Definition Shader.h:61
virtual ~Shader()=default
Destructor.
virtual void Bind(const std::string &texShaderNames) const
Binding using name of texture.
Definition Shader.h:53
Shader()
A constructor.
Definition Shader.h:29