Cogs.Core
EnvironmentSystem.cpp
1#include <algorithm>
2#include "EnvironmentSystem.h"
3#include "Resources/TextureManager.h"
4
5namespace {
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
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}
void update()
Updates the system state to that of the current frame.
ComponentPool< ComponentType > pool
Pool of components managed by the system.
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Definition: Context.h:83
Contains the Engine, Renderer, resource managers and other systems needed to run Cogs....