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
13#include "Texture.h"
14#include "Camera/Camera.h"
15#include <list>
16
17namespace Karma
18{
27 {
28 public:
34 Material();
35
41 void OnUpdate();
42
50
56 void AttatchMainCamera(std::shared_ptr<Camera> mCamera);
57
63 void AddShader(std::shared_ptr<Shader> shader) { m_Shaders.push_back(shader); }
64
70 void RemoveShader(std::shared_ptr<Shader> shader) { m_Shaders.remove(shader); }
71
77 void AddTexture(std::shared_ptr<Texture> texture) { m_Textures.push_back(texture); }
78
84 void RemoveTexture(std::shared_ptr<Texture> texture) { m_Textures.remove(texture); }
85
86 // Getters
92 std::shared_ptr<Shader> GetShader(const std::string& shaderName) const;
93
99 std::shared_ptr<Shader> GetShader(int index);
100
106 std::shared_ptr<Texture> GetTexture(int index);
107
108 // May add Physics-relevant features in future.
109
110 private:
111 // References to shaders, textures
112 std::list<std::shared_ptr<Shader>> m_Shaders;
113 std::list<std::shared_ptr<Texture>> m_Textures;
114
115 std::shared_ptr<Camera> m_MainCamera;
116 };
117}
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:84
void AddTexture(std::shared_ptr< Texture > texture)
Add to the list of textures used by this material.
Definition Material.h:77
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:70
void AddShader(std::shared_ptr< Shader > shader)
Add to the list of shaders used by this material.
Definition Material.h:63
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