CSEngine
Loading...
Searching...
No Matches
CSE::RenderMgr Class Reference

Class for managing rendering operations. More...

#include <RenderMgr.h>

Inheritance diagram for CSE::RenderMgr:
CSE::RenderContainer CSE::CoreBufferContainer CSE::CoreBase CSE::RenderCoreBase

Public Member Functions

 RenderMgr ()
 Constructor for RenderMgr.
 
void Init () override
 Initialization of resources required for rendering.
 
void SetViewport ()
 Modify the framebuffer to fit the modified screen size.
 
void Render () const override
 Rendering all stuffs.
 
unsigned int * GetWidth () const
 Get the width of the screen.
 
unsigned int * GetHeight () const
 Get the height of the screen.
 
- Public Member Functions inherited from CSE::RenderContainer
void Register (SIRender *object, RenderGroupMode groupMode)
 
void Remove (SIRender *object, RenderGroupMode groupFlag)
 
- Public Member Functions inherited from CSE::CoreBufferContainer
SFrameBufferGetMainBuffer () const
 
- Public Member Functions inherited from CSE::CoreBase
virtual void Update (float elapsedTime)
 

Protected Member Functions

void Exterminate () override
 Destroy all resources used for rendering.
 
- Protected Member Functions inherited from CSE::CoreBufferContainer
void InitBuffers (int width, int height)
 
void ResizeBuffers (int width, int height)
 

Additional Inherited Members

- Public Types inherited from CSE::RenderContainer
enum  RenderGroupMode { FORWARD = 0 , DEFERRED = 1 , DEPTH_ONLY = 2 }
 
- Protected Attributes inherited from CSE::RenderContainer
SRenderGroupm_forwardRenderGroup = nullptr
 
SRenderGroupm_deferredRenderGroup = nullptr
 
SRenderGroupm_depthOnlyRenderGroup = nullptr
 
unsigned int * m_width = nullptr
 
unsigned int * m_height = nullptr
 

Detailed Description

Class for managing rendering operations.

This class is responsible for managing all elements involved in the rendering operation, including cameras, buffers, etc.

Definition at line 21 of file RenderMgr.h.

Constructor & Destructor Documentation

◆ ~RenderMgr()

RenderMgr::~RenderMgr ( )
override

Definition at line 23 of file RenderMgr.cpp.

23 {
25}
void Exterminate() override
Destroy all resources used for rendering.
Definition RenderMgr.cpp:96

Member Function Documentation

◆ Exterminate()

void RenderMgr::Exterminate ( )
overrideprotectedvirtual

Destroy all resources used for rendering.

Reimplemented from CSE::RenderContainer.

Definition at line 96 of file RenderMgr.cpp.

96 {
97 RenderContainer::Exterminate();
98}

◆ GetHeight()

unsigned int * CSE::RenderMgr::GetHeight ( ) const
inline

Get the height of the screen.

Returns
Pointer to the height of the screen.

Definition at line 59 of file RenderMgr.h.

59 {
60 return m_height;
61 }

Referenced by CSE::DeferredRenderGroup::DeferredRenderGroup().

◆ GetWidth()

unsigned int * CSE::RenderMgr::GetWidth ( ) const
inline

Get the width of the screen.

Returns
Pointer to the width of the screen.

Definition at line 50 of file RenderMgr.h.

50 {
51 return m_width;
52 }

Referenced by CSE::DeferredRenderGroup::DeferredRenderGroup().

◆ Init()

void RenderMgr::Init ( )
overridevirtual

Initialization of resources required for rendering.

Implements CSE::CoreBase.

Definition at line 27 of file RenderMgr.cpp.

27 {
28 cameraMgr = CORE->GetCore(CameraMgr);
29 lightMgr = CORE->GetCore(LightMgr);
30
31 m_width = SEnvironmentMgr::GetPointerWidth();
32 m_height = SEnvironmentMgr::GetPointerHeight();
33
34 InitBuffers((int)*m_width, (int)*m_height);
35
36 m_forwardRenderGroup = new ForwardRenderGroup(*this);
37 m_deferredRenderGroup = new DeferredRenderGroup(*this);
38 m_depthOnlyRenderGroup = new DepthOnlyRenderGroup(*this);
39}

◆ Render()

void RenderMgr::Render ( ) const
overridevirtual

Rendering all stuffs.

Implements CSE::RenderCoreBase.

Definition at line 47 of file RenderMgr.cpp.

47 {
48 // 1. Render depth buffer for shadows.
49 RenderShadows();
50
51 // 2. Render active sub cameras.
52 RenderSubCameras();
53
54 // 3. Main Render Buffer
55 RenderMainCamera();
56}

◆ SetViewport()

void RenderMgr::SetViewport ( )

Modify the framebuffer to fit the modified screen size.

Attention
This is a function that can have a big impact on performance.

Definition at line 41 of file RenderMgr.cpp.

41 {
42 if(m_deferredRenderGroup != nullptr)
43 static_cast<DeferredRenderGroup*>(m_deferredRenderGroup)->SetViewport();
44 ResizeBuffers((int)*m_width, (int)*m_height);
45}
void SetViewport()
Modify the framebuffer to fit the modified screen size.
Definition RenderMgr.cpp:41

References SetViewport().

Referenced by SetViewport().


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