Handle windows and EnTT with application components

This commit is contained in:
SirLynix
2023-01-21 12:03:02 +01:00
committed by Jérôme Leclercq
parent 18851c9185
commit da9eb14ebe
16 changed files with 287 additions and 65 deletions

View 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);
}
}

View File

@@ -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)
{
}
}

View File

@@ -28,5 +28,10 @@ namespace Nz
void ApplicationBase::Update(Time elapsedTime)
{
for (auto& componentPtr : m_components)
{
if (componentPtr)
componentPtr->Update(elapsedTime);
}
}
}