Cogs.Core
Source
Systems
Core
EnvironmentSystem.cpp
1
#include <algorithm>
2
#include "EnvironmentSystem.h"
3
#include "Resources/TextureManager.h"
4
5
namespace
{
6
using namespace
Cogs::Core
;
7
8
void
updateLod(
unsigned
& lods,
TextureHandle
tex)
9
{
10
if
(tex) {
11
lods = tex->description.levels;
12
}
13
}
14
15
16
}
17
18
void
Cogs::Core::EnvironmentSystem::update
(
Context
*
/*context*/
)
19
{
20
for
(
auto
& envComp :
pool
) {
21
auto
& envData = getData(&envComp);
22
23
updateLod(envData.radianceLods, envComp.radiance);
24
updateLod(envData.irradianceLods, envComp.irradiance);
25
updateLod(envData.ambientIrradianceLods, envComp.ambientIrradiance);
26
}
27
}
Cogs::Core::ComponentSystemBase::update
void update()
Updates the system state to that of the current frame.
Definition:
ComponentSystem.h:65
Cogs::Core::ComponentSystem::pool
ComponentPool< ComponentType > pool
Pool of components managed by the system.
Definition:
ComponentSystem.h:235
Cogs::Core::Context
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Definition:
Context.h:83
Cogs::Core
Contains the Engine, Renderer, resource managers and other systems needed to run Cogs....
Definition:
ComponentFunctions.h:10
Cogs::Core::ResourceHandle_t< Texture >
Generated by
1.9.6