Elevate Engine 1
Loading...
Searching...
No Matches
Elevate::SceneLayer Class Reference

Simple layer thats contains a single scene and take care of all loading/unloading update and rendering. This is a good starting point if your are looking to create your own scene logic. More...

#include <SceneLayer.h>

Inheritance diagram for Elevate::SceneLayer:
Elevate::Layer

Public Member Functions

 SceneLayer (std::shared_ptr< Scene > scene)
 
virtual void OnDetach () override
 
virtual void OnUpdate () override
 
virtual void OnRender () override
 
void OnRender (Camera *cam)
 
virtual void OnEvent (Event &event) override
 
- Public Member Functions inherited from Elevate::Layer
 Layer (const std::string &name="Layer")
 
virtual ~Layer ()
 
virtual void OnAttach ()
 
virtual void OnImGuiRender ()
 
const std::string & GetName () const
 

Protected Attributes

std::shared_ptr< Scenem_scene
 
- Protected Attributes inherited from Elevate::Layer
std::string m_DebugName
 

Detailed Description

Simple layer thats contains a single scene and take care of all loading/unloading update and rendering. This is a good starting point if your are looking to create your own scene logic.

Definition at line 15 of file SceneLayer.h.

Constructor & Destructor Documentation

◆ SceneLayer()

Elevate::SceneLayer::SceneLayer ( std::shared_ptr< Scene scene)
inline

Definition at line 18 of file SceneLayer.h.

19 : m_scene(scene) { }
std::shared_ptr< Scene > m_scene
Definition SceneLayer.h:30

Member Function Documentation

◆ OnDetach()

void Elevate::SceneLayer::OnDetach ( )
overridevirtual

Reimplemented from Elevate::Layer.

Definition at line 8 of file SceneLayer.cpp.

9{
11}
static void UnloadScene(ScenePtr scene)

◆ OnEvent()

void Elevate::SceneLayer::OnEvent ( Event event)
overridevirtual

Reimplemented from Elevate::Layer.

Definition at line 36 of file SceneLayer.cpp.

37{
38 m_scene->Notify(event);
39}

◆ OnRender() [1/2]

void Elevate::SceneLayer::OnRender ( )
overridevirtual

Reimplemented from Elevate::Layer.

Definition at line 18 of file SceneLayer.cpp.

19{
20 OnRender(nullptr);
21}
virtual void OnRender() override

◆ OnRender() [2/2]

void Elevate::SceneLayer::OnRender ( Camera cam)

Definition at line 23 of file SceneLayer.cpp.

24{
25 if (cam)
26 {
28 m_scene->RenderScene(cam);
29 }
30 else
31 {
32 EE_CORE_ERROR("Cannot render a scene with a nullptr camera.");
33 }
34}
static void BeginFrame(const ScenePtr scene, const Camera &cam)
Definition Renderer.cpp:21

◆ OnUpdate()

void Elevate::SceneLayer::OnUpdate ( )
overridevirtual

Reimplemented from Elevate::Layer.

Definition at line 13 of file SceneLayer.cpp.

14{
15 m_scene->UpdateScene();
16}

Member Data Documentation

◆ m_scene

std::shared_ptr<Scene> Elevate::SceneLayer::m_scene
protected

Definition at line 30 of file SceneLayer.h.


The documentation for this class was generated from the following files: