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 "krpch.h"
13
14#include "Camera.h"
15#include "VertexArray.h"
16
17namespace Karma
18{
23 {
24 public:
30 Scene();
31
37 ~Scene();
38
45 void AddVertexArray(std::shared_ptr<VertexArray> vertexArray);
46
53 void AddCamera(std::shared_ptr<Camera> camera);
54
61 void SetClearColor(const glm::vec4& clearColor) { m_ClearColor = clearColor; }
62
74 void SetRenderWindow(void* window) { m_WindowToRenderWithin = window; };
75
83 void SetWindowToRenderWithinResize(bool bStatus) { m_WindowResize = bStatus; }
84
85 // Getters
91 std::shared_ptr<VertexArray> GetRenderableVertexArray() const;
92
98 std::shared_ptr<Camera> GetSceneCamera() const;
99
105 inline const glm::vec4& GetClearColor() const { return m_ClearColor; }
106
112 inline const std::vector<std::shared_ptr<VertexArray>>& GetAllVertexArrays() const { return m_VertexArrays; }
113
119 inline const std::vector<std::shared_ptr<Camera>>& GetAllCameras() const { return m_Cameras; }
120
126 inline void* GetRenderingWindow() const { return m_WindowToRenderWithin; }
127
133 inline bool GetWindowToRenderWithinResizeStatus() const { return m_WindowResize; }
134
135 private:
136 std::vector<std::shared_ptr<VertexArray>> m_VertexArrays;
137 std::vector<std::shared_ptr<Camera>> m_Cameras;
138
139 glm::vec4 m_ClearColor;
140
141 // Caution: raw pointer, courtsey authors of Dear ImGui
142 void* m_WindowToRenderWithin;
143 bool m_WindowResize;
144 };
145}
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.
void SetRenderWindow(void *window)
Set the Window in which the Scene is to be rendered.
Definition Scene.h:74
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:83
void AddCamera(std::shared_ptr< Camera > camera)
Add Camera.
Definition Scene.cpp:31
void AddVertexArray(std::shared_ptr< VertexArray > vertexArray)
Add a VertexArray (Mesh + Material) to the list of renderable VertexArrays.
Definition Scene.cpp:26
void SetClearColor(const glm::vec4 &clearColor)
Set the m_ClearColor variable.
Definition Scene.h:61
const std::vector< std::shared_ptr< Camera > > & GetAllCameras() const
Get the list of all Cameras.
Definition Scene.h:119
void * GetRenderingWindow() const
Getter for the window in which the scene is rendered.
Definition Scene.h:126
bool GetWindowToRenderWithinResizeStatus() const
Getter for the status of wether the window resize is to be handled.
Definition Scene.h:133
Scene()
A constructor.
Definition Scene.cpp:5
const glm::vec4 & GetClearColor() const
Getter for the m_ClearColor.
Definition Scene.h:105
const std::vector< std::shared_ptr< VertexArray > > & GetAllVertexArrays() const
Get the list of VertexArrays.
Definition Scene.h:112