Handle windows and EnTT with application components
This commit is contained in:
committed by
Jérôme Leclercq
parent
18851c9185
commit
da9eb14ebe
14
src/Nazara/Core/AppEntitySystemComponent.cpp
Normal file
14
src/Nazara/Core/AppEntitySystemComponent.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
// Copyright (C) 2022 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
|
||||
// This file is part of the "Nazara Engine - Platform module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Core/AppEntitySystemComponent.hpp>
|
||||
#include <Nazara/Core/Debug.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
void AppEntitySystemComponent::Update(Time elapsedTime)
|
||||
{
|
||||
m_systemGraph.Update(elapsedTime);
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
// Copyright (C) 2022 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
|
||||
// This file is part of the "Nazara Engine - Core module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Core/Application.hpp>
|
||||
#include <Nazara/Core/Debug.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
Application::Application(int argc, const char** argv) :
|
||||
m_running(true)
|
||||
{
|
||||
}
|
||||
|
||||
int Application::Run()
|
||||
{
|
||||
// Ignore time between creation and Run() call
|
||||
m_clock.Restart();
|
||||
|
||||
while (m_running)
|
||||
{
|
||||
Time elapsedTime = m_clock.Restart();
|
||||
Update(elapsedTime);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Application::Update(Time elapsedTime)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -28,5 +28,10 @@ namespace Nz
|
||||
|
||||
void ApplicationBase::Update(Time elapsedTime)
|
||||
{
|
||||
for (auto& componentPtr : m_components)
|
||||
{
|
||||
if (componentPtr)
|
||||
componentPtr->Update(elapsedTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user