CSEngine
Loading...
Searching...
No Matches
RenderContainer.cpp
1#include "RenderContainer.h"
2#include "../../Util/Render/SFrameBuffer.h"
3#include "../../Util/Render/SMaterial.h"
4#include "../../Util/Render/SGBuffer.h"
5
6using namespace CSE;
7
8RenderContainer::RenderContainer() {}
9
10
11RenderContainer::~RenderContainer() {}
12
13void RenderContainer::Register(SIRender* object, RenderGroupMode groupMode) {
14 switch (groupMode) {
15 case FORWARD:
16 m_forwardRenderGroup->RegisterObject(object);
17 break;
18 case DEFERRED:
19 m_deferredRenderGroup->RegisterObject(object);
20 break;
21 case DEPTH_ONLY:
22 m_depthOnlyRenderGroup->RegisterObject(object);
23 break;
24 }
25}
26
27void RenderContainer::Remove(SIRender* object, RenderContainer::RenderGroupMode groupFlag) {
28 switch (groupFlag) {
29 case FORWARD:
30 m_forwardRenderGroup->RemoveObjects(object);
31 break;
32 case DEFERRED:
33 m_deferredRenderGroup->RemoveObjects(object);
34 break;
35 case DEPTH_ONLY:
36 m_depthOnlyRenderGroup->RegisterObject(object);
37 break;
38 }
39}
40
41void RenderContainer::Exterminate() {
42 m_forwardRenderGroup->Exterminate();
43 SAFE_DELETE(m_forwardRenderGroup);
44 m_deferredRenderGroup->Exterminate();
45 SAFE_DELETE(m_deferredRenderGroup);
46 m_depthOnlyRenderGroup->Exterminate();
47 SAFE_DELETE(m_depthOnlyRenderGroup);
48}