KarmaEngine
Game Engine for practical learning and research purposes
Loading...
Searching...
No Matches
Scene.h
Go to the documentation of this file.
1
10#pragma once
11
12#include "Camera.h"
13#include "VertexArray.h"
14
15namespace Karma
16{
17
18 class AStaticMeshActor;
19
24 {
25 public:
31 Scene();
32
38 ~Scene();
39
46 void AddVertexArray(std::shared_ptr<VertexArray> vertexArray);
47
55
62 void AddCamera(std::shared_ptr<Camera> camera);
63
70 void SetClearColor(const glm::vec4& clearColor) { m_ClearColor = clearColor; }
71
83 void SetRenderWindow(void* window) { m_WindowToRenderWithin = window; };
84
92 void SetWindowToRenderWithinResize(bool bStatus) { m_WindowResize = bStatus; }
93
94 // Getters
100 const std::vector<AStaticMeshActor*>& GetSMActors() const { return m_SMActors; }
101
107 std::shared_ptr<Camera> GetSceneCamera() const;
108
114 inline const glm::vec4& GetClearColor() const { return m_ClearColor; }
115
121 inline const std::vector<std::shared_ptr<Camera>>& GetAllCameras() const { return m_Cameras; }
122
128 inline void* GetRenderingWindow() const { return m_WindowToRenderWithin; }
129
135 inline bool GetWindowToRenderWithinResizeStatus() const { return m_WindowResize; }
136
137 private:
138 std::vector<AStaticMeshActor*> m_SMActors;
139 std::vector<std::shared_ptr<Camera>> m_Cameras;
140
141 glm::vec4 m_ClearColor;
142
143 // Caution: raw pointer, courtsey authors of Dear ImGui
144 void* m_WindowToRenderWithin;
145 bool m_WindowResize;
146 };
147}
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 VertexArray class.
An actor that contains a static mesh component, allowing the mesh to be rendered in the game world.
Definition StaticMeshActor.h:25
void SetRenderWindow(void *window)
Set the Window in which the Scene is to be rendered.
Definition Scene.h:83
void SetWindowToRenderWithinResize(bool bStatus)
Sets the status of the m_WindowResize true if resize is done so that necessary reset and reallocation...
Definition Scene.h:92
void AddCamera(std::shared_ptr< Camera > camera)
Add Camera.
Definition Scene.cpp:29
void AddVertexArray(std::shared_ptr< VertexArray > vertexArray)
Add a VertexArray (Mesh + Material) to the list of renderable VertexArrays.
void SetClearColor(const glm::vec4 &clearColor)
Set the m_ClearColor variable.
Definition Scene.h:70
const std::vector< std::shared_ptr< Camera > > & GetAllCameras() const
Get the list of all Cameras.
Definition Scene.h:121
void * GetRenderingWindow() const
Getter for the window in which the scene is rendered.
Definition Scene.h:128
bool GetWindowToRenderWithinResizeStatus() const
Getter for the status of wether the window resize is to be handled.
Definition Scene.h:135
Scene()
A constructor.
Definition Scene.cpp:8
const std::vector< AStaticMeshActor * > & GetSMActors() const
Get the list of StaticMeshActors in the scene.
Definition Scene.h:100
const glm::vec4 & GetClearColor() const
Getter for the m_ClearColor.
Definition Scene.h:114
void AddStaticMeshActor(AStaticMeshActor *smActor)
Add StaticMeshActor to the scene.
Definition Scene.cpp:23