MCPcopy Create free account
hub / github.com/NazaraEngine/NazaraEngine / Update

Method Update

examples/Particles/Common.cpp:35–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35bool ParticleDemo::Update(Ndk::StateMachine& /*fsm*/, float elapsedTime)
36{
37 m_fpsCounter++;
38 if (m_updateClock.GetMilliseconds() > 1000)
39 {
40 m_updateClock.Restart();
41
42 m_shared.fpsCount->Update(Nz::SimpleTextDrawer::Draw(Nz::String::Number(m_fpsCounter) + " FPS", 24));
43 m_fpsCounter = 0;
44
45 unsigned int particleCount = 0;
46 for (const Ndk::EntityHandle& entity : m_particleGroups)
47 {
48 const Ndk::ParticleGroupComponent& group = entity->GetComponent<Ndk::ParticleGroupComponent>();
49 particleCount += group.GetParticleCount();
50 }
51
52 m_shared.particleCount->Update(Nz::SimpleTextDrawer::Draw(Nz::String::Number(particleCount) + " particles", 36));
53 }
54
55 return true;
56}
57
58void ParticleDemo::RegisterEntity(const Ndk::EntityHandle& entity)
59{

Callers 3

EnterMethod · 0.45
mainFunction · 0.45
mainFunction · 0.45

Calls 3

GetMillisecondsMethod · 0.80
RestartMethod · 0.80
GetParticleCountMethod · 0.80

Tested by

no test coverage detected