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 = 10.f;
22
23 public:
27 explicit LightMgr();
28
32 ~LightMgr() override;
33
38 void AttachLightToShader(const GLProgramHandle* handle) const;
39
45 void 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 private:
75 std::list<SIRender*> m_shadowObject;
76 mutable int m_shadowCount = 0;
77
78 /*mutable*/ int m_lightMapCount = 3;
79
80 SEnvironmentMgr* m_environmentMgr = nullptr;
81 };
82
83}
void Init() override
Definition LightMgr.cpp:51
int GetShadowCount() const
Definition LightMgr.h:56
void RefreshShadowCount(int shadowCount=-1) const
Definition LightMgr.cpp:57
void AttachLightMapToShader(const GLProgramHandle *handle, int textureLayout) const
Definition LightMgr.cpp:47
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
void AttachLightToShader(const GLProgramHandle *handle) const
Definition LightMgr.cpp:15
~LightMgr() override
Definition LightMgr.cpp:10
int GetLightMapCount() const
Definition LightMgr.h:64
static constexpr float SHADOW_DISTANCE
Distance of the shadow map.
Definition LightMgr.h:21