KarmaEngine
Game Engine for practical learning and research purposes
Loading...
Searching...
No Matches
Material.h
Go to the documentation of this file.
1
10#pragma once
11
12#include "krpch.h"
13
15
16#include "Texture.h"
17#include "Camera/Camera.h"
18
19namespace Karma
20{
29 {
30 public:
36 Material();
37
43 void OnUpdate();
44
52
58 void AttatchMainCamera(std::shared_ptr<Camera> mCamera);
59
65 void AddShader(std::shared_ptr<Shader> shader) { m_Shaders.push_back(shader); }
66
72 void RemoveShader(std::shared_ptr<Shader> shader) { m_Shaders.remove(shader); }
73
79 void AddTexture(std::shared_ptr<Texture> texture) { m_Textures.push_back(texture); }
80
86 void RemoveTexture(std::shared_ptr<Texture> texture) { m_Textures.remove(texture); }
87
88 // Getters
94 std::shared_ptr<Shader> GetShader(const std::string& shaderName) const;
95
101 std::shared_ptr<Shader> GetShader(int index);
102
108 std::shared_ptr<Texture> GetTexture(int index);
109
110 // May add Physics-relevant features in future.
111
112 private:
113 // References to shaders, textures
114 std::list<std::shared_ptr<Shader>> m_Shaders;
115 std::list<std::shared_ptr<Texture>> m_Textures;
116
117 std::shared_ptr<Camera> m_MainCamera;
118 };
119}
This file contains Camera class.
#define KARMA_API
Defining Karma's API macro for storage class information.
Definition Core.h:41
This file contains the Shader class.
This file contains the SkeletalMesh class.
void RemoveTexture(std::shared_ptr< Texture > texture)
Remove from the list of textures.
Definition Material.h:86
void AddTexture(std::shared_ptr< Texture > texture)
Add to the list of textures used by this material.
Definition Material.h:79
void OnUpdate()
A hook into the game loop for updating uniforms and related stuff.
Definition Material.cpp:9
void AttatchMainCamera(std::shared_ptr< Camera > mCamera)
Caching the current camera (m_MainCamera)
Definition Material.cpp:28
void RemoveShader(std::shared_ptr< Shader > shader)
Remove from the list of shaders.
Definition Material.h:72
void AddShader(std::shared_ptr< Shader > shader)
Add to the list of shaders used by this material.
Definition Material.h:65
void ProcessForSubmission()
Process for various things belonging to the material before submitting the VertexArray (or issuing dr...
Definition Material.cpp:33
Material()
A constructor.
Definition Material.cpp:5