CSEngine
Loading...
Searching...
No Matches
LightMgr.h
1#pragma once
2
3#include <list>
4#include "Base/SContainerList.h"
5#include "../Component/LightComponent.h"
6#include "../Util/Render/RenderInterfaces.h"
7
8namespace CSE {
9
10 class GLProgramHandle;
11 class SEnvironmentMgr;
12
17 class LightMgr : public SContainerList<LightComponent*>, public CoreBase {
18 public:
19 const int SHADOW_WIDTH = 1024;
20 const int SHADOW_HEIGHT = 1024;
21 constexpr static float SHADOW_DISTANCE = 100.f;
22
23 public:
27 explicit LightMgr();
28
32 ~LightMgr() override;
33
38 int AttachLightToShader(const GLProgramHandle* handle) const;
39
45 int AttachLightMapToShader(const GLProgramHandle* handle, int textureLayout) const;
46
50 void Init() override;
51
56 int GetShadowCount() const {
57 return m_shadowCount;
58 }
59
64 int GetLightMapCount() const {
65 return m_lightMapCount;
66 }
67
72 void RefreshShadowCount(int shadowCount = -1) const;
73
74 static void ExterminateGlobalSettings();
75
76 private:
77 std::list<SIRender*> m_shadowObject;
78 mutable int m_shadowCount = 0;
79
80 /*mutable*/ int m_lightMapCount = 3;
81
82 SEnvironmentMgr* m_environmentMgr = nullptr;
83 };
84
85}
void Init() override
Definition LightMgr.cpp:53
int GetShadowCount() const
Definition LightMgr.h:56
void RefreshShadowCount(int shadowCount=-1) const
Definition LightMgr.cpp:61
const int SHADOW_HEIGHT
Height of the shadow map.
Definition LightMgr.h:20
const int SHADOW_WIDTH
Width of the shadow map.
Definition LightMgr.h:19
~LightMgr() override
Definition LightMgr.cpp:10
int GetLightMapCount() const
Definition LightMgr.h:64
int AttachLightMapToShader(const GLProgramHandle *handle, int textureLayout) const
Definition LightMgr.cpp:47
static constexpr float SHADOW_DISTANCE
Distance of the shadow map.
Definition LightMgr.h:21
int AttachLightToShader(const GLProgramHandle *handle) const
Definition LightMgr.cpp:15