Rename AppComponent classes (AppEntitySystemComponent => EntitySystemAppComponent)

This commit is contained in:
SirLynix 2024-01-24 16:50:04 +01:00
parent 3421c0f50b
commit bb3b28279b
25 changed files with 89 additions and 89 deletions

View File

@ -89,7 +89,7 @@ int main(int argc, char* argv[])
std::shared_ptr<Nz::RenderDevice> device = Nz::Graphics::Instance()->GetRenderDevice(); std::shared_ptr<Nz::RenderDevice> device = Nz::Graphics::Instance()->GetRenderDevice();
const Nz::RenderDeviceInfo& deviceInfo = device->GetDeviceInfo(); const Nz::RenderDeviceInfo& deviceInfo = device->GetDeviceInfo();
auto& windowing = app.AddComponent<Nz::AppWindowingComponent>(); auto& windowing = app.AddComponent<Nz::WindowingAppComponent>();
std::string windowTitle = "Graphics Test"; std::string windowTitle = "Graphics Test";
Nz::Window& window = windowing.CreateWindow(Nz::VideoMode(1920, 1080), windowTitle); Nz::Window& window = windowing.CreateWindow(Nz::VideoMode(1920, 1080), windowTitle);

View File

@ -17,7 +17,7 @@ int main(int argc, char* argv[])
std::shared_ptr<Nz::RenderDevice> device = Nz::Graphics::Instance()->GetRenderDevice(); std::shared_ptr<Nz::RenderDevice> device = Nz::Graphics::Instance()->GetRenderDevice();
auto& windowing = app.AddComponent<Nz::AppWindowingComponent>(); auto& windowing = app.AddComponent<Nz::WindowingAppComponent>();
std::string windowTitle = "Physically Based Rendering Test"; std::string windowTitle = "Physically Based Rendering Test";
Nz::Window& window = windowing.CreateWindow(Nz::VideoMode(1920, 1080), windowTitle); Nz::Window& window = windowing.CreateWindow(Nz::VideoMode(1920, 1080), windowTitle);

View File

@ -23,9 +23,9 @@ int main(int argc, char* argv[])
Nz::Application<Nz::Graphics, Nz::ChipmunkPhysics2D> app(argc, argv); Nz::Application<Nz::Graphics, Nz::ChipmunkPhysics2D> app(argc, argv);
auto& windowing = app.AddComponent<Nz::AppWindowingComponent>(); auto& windowing = app.AddComponent<Nz::WindowingAppComponent>();
auto& ecs = app.AddComponent<Nz::AppEntitySystemComponent>(); auto& ecs = app.AddComponent<Nz::EntitySystemAppComponent>();
auto& world = ecs.AddWorld<Nz::EnttWorld>(); auto& world = ecs.AddWorld<Nz::EnttWorld>();
Nz::ChipmunkPhysics2DSystem& physSytem = world.AddSystem<Nz::ChipmunkPhysics2DSystem>(); Nz::ChipmunkPhysics2DSystem& physSytem = world.AddSystem<Nz::ChipmunkPhysics2DSystem>();

View File

@ -22,9 +22,9 @@ int main(int argc, char* argv[])
Nz::Application<Nz::Graphics, Nz::BulletPhysics3D> app(argc, argv); Nz::Application<Nz::Graphics, Nz::BulletPhysics3D> app(argc, argv);
auto& windowing = app.AddComponent<Nz::AppWindowingComponent>(); auto& windowing = app.AddComponent<Nz::WindowingAppComponent>();
auto& ecs = app.AddComponent<Nz::AppEntitySystemComponent>(); auto& ecs = app.AddComponent<Nz::EntitySystemAppComponent>();
auto& world = ecs.AddWorld<Nz::EnttWorld>(); auto& world = ecs.AddWorld<Nz::EnttWorld>();
Nz::BulletPhysics3DSystem& physSytem = world.AddSystem<Nz::BulletPhysics3DSystem>(); Nz::BulletPhysics3DSystem& physSytem = world.AddSystem<Nz::BulletPhysics3DSystem>();

View File

@ -4,7 +4,7 @@
#include <Nazara/Core.hpp> #include <Nazara/Core.hpp>
#include <Nazara/Graphics.hpp> #include <Nazara/Graphics.hpp>
#include <Nazara/Platform/AppWindowingComponent.hpp> #include <Nazara/Platform/WindowingAppComponent.hpp>
#if USE_JOLT #if USE_JOLT
#include <Nazara/JoltPhysics3D.hpp> #include <Nazara/JoltPhysics3D.hpp>
#else #else
@ -30,10 +30,10 @@ int main(int argc, char* argv[])
Nz::Application<Nz::Graphics, Nz::BulletPhysics3D> app(argc, argv, renderConfig); Nz::Application<Nz::Graphics, Nz::BulletPhysics3D> app(argc, argv, renderConfig);
#endif #endif
auto& windowing = app.AddComponent<Nz::AppWindowingComponent>(); auto& windowing = app.AddComponent<Nz::WindowingAppComponent>();
Nz::Window& mainWindow = windowing.CreateWindow(Nz::VideoMode(1280, 720), "Physics playground"); Nz::Window& mainWindow = windowing.CreateWindow(Nz::VideoMode(1280, 720), "Physics playground");
auto& fs = app.AddComponent<Nz::AppFilesystemComponent>(); auto& fs = app.AddComponent<Nz::FilesystemAppComponent>();
{ {
std::filesystem::path resourceDir = "assets/examples"; std::filesystem::path resourceDir = "assets/examples";
if (!std::filesystem::is_directory(resourceDir) && std::filesystem::is_directory("../.." / resourceDir)) if (!std::filesystem::is_directory(resourceDir) && std::filesystem::is_directory("../.." / resourceDir))
@ -42,7 +42,7 @@ int main(int argc, char* argv[])
fs.Mount("assets", resourceDir); fs.Mount("assets", resourceDir);
} }
auto& ecs = app.AddComponent<Nz::AppEntitySystemComponent>(); auto& ecs = app.AddComponent<Nz::EntitySystemAppComponent>();
auto& world = ecs.AddWorld<Nz::EnttWorld>(); auto& world = ecs.AddWorld<Nz::EnttWorld>();
#if USE_JOLT #if USE_JOLT

View File

@ -26,7 +26,7 @@ int main(int argc, char* argv[])
std::shared_ptr<Nz::RenderDevice> device = Nz::Graphics::Instance()->GetRenderDevice(); std::shared_ptr<Nz::RenderDevice> device = Nz::Graphics::Instance()->GetRenderDevice();
auto& ecs = app.AddComponent<Nz::AppEntitySystemComponent>(); auto& ecs = app.AddComponent<Nz::EntitySystemAppComponent>();
auto& world = ecs.AddWorld<Nz::EnttWorld>(); auto& world = ecs.AddWorld<Nz::EnttWorld>();
world.AddSystem<Nz::SkeletonSystem>(); world.AddSystem<Nz::SkeletonSystem>();
@ -35,13 +35,13 @@ int main(int argc, char* argv[])
physSytem.GetPhysWorld().SetGravity(Nz::Vector3f::Zero()); physSytem.GetPhysWorld().SetGravity(Nz::Vector3f::Zero());
Nz::RenderSystem& renderSystem = world.AddSystem<Nz::RenderSystem>(); Nz::RenderSystem& renderSystem = world.AddSystem<Nz::RenderSystem>();
auto& windowing = app.AddComponent<Nz::AppWindowingComponent>(); auto& windowing = app.AddComponent<Nz::WindowingAppComponent>();
std::string windowTitle = "Skinning test"; std::string windowTitle = "Skinning test";
Nz::Window& mainWindow = windowing.CreateWindow(Nz::VideoMode(1280, 720), windowTitle); Nz::Window& mainWindow = windowing.CreateWindow(Nz::VideoMode(1280, 720), windowTitle);
auto& windowSwapchain = renderSystem.CreateSwapchain(mainWindow); auto& windowSwapchain = renderSystem.CreateSwapchain(mainWindow);
auto& fs = app.AddComponent<Nz::AppFilesystemComponent>(); auto& fs = app.AddComponent<Nz::FilesystemAppComponent>();
{ {
std::filesystem::path resourceDir = "assets/examples"; std::filesystem::path resourceDir = "assets/examples";
if (!std::filesystem::is_directory(resourceDir) && std::filesystem::is_directory("../.." / resourceDir)) if (!std::filesystem::is_directory(resourceDir) && std::filesystem::is_directory("../.." / resourceDir))

View File

@ -2,7 +2,7 @@
#include <Nazara/Core.hpp> #include <Nazara/Core.hpp>
#include <Nazara/Graphics.hpp> #include <Nazara/Graphics.hpp>
#include <Nazara/Platform/AppWindowingComponent.hpp> #include <Nazara/Platform/WindowingAppComponent.hpp>
#include <Nazara/Renderer.hpp> #include <Nazara/Renderer.hpp>
#include <Nazara/Utility.hpp> #include <Nazara/Utility.hpp>
#include <iostream> #include <iostream>
@ -12,10 +12,10 @@ int main(int argc, char* argv[])
// Mise en place de l'application, de la fenêtre et du monde // Mise en place de l'application, de la fenêtre et du monde
Nz::Application<Nz::Graphics> app(argc, argv); Nz::Application<Nz::Graphics> app(argc, argv);
auto& windowing = app.AddComponent<Nz::AppWindowingComponent>(); auto& windowing = app.AddComponent<Nz::WindowingAppComponent>();
Nz::Window& mainWindow = windowing.CreateWindow(Nz::VideoMode(1280, 720), "Tut01 - Hello world"); Nz::Window& mainWindow = windowing.CreateWindow(Nz::VideoMode(1280, 720), "Tut01 - Hello world");
auto& ecs = app.AddComponent<Nz::AppEntitySystemComponent>(); auto& ecs = app.AddComponent<Nz::EntitySystemAppComponent>();
auto& world = ecs.AddWorld<Nz::EnttWorld>(); auto& world = ecs.AddWorld<Nz::EnttWorld>();
auto& renderSystem = world.AddSystem<Nz::RenderSystem>(); auto& renderSystem = world.AddSystem<Nz::RenderSystem>();

View File

@ -2,7 +2,7 @@
#include <Nazara/Core.hpp> #include <Nazara/Core.hpp>
#include <Nazara/Graphics.hpp> #include <Nazara/Graphics.hpp>
#include <Nazara/Platform/AppWindowingComponent.hpp> #include <Nazara/Platform/WindowingAppComponent.hpp>
#include <Nazara/Renderer.hpp> #include <Nazara/Renderer.hpp>
#include <Nazara/Utility.hpp> #include <Nazara/Utility.hpp>
#include <iostream> #include <iostream>
@ -12,11 +12,11 @@ int main(int argc, char* argv[])
Nz::Application<Nz::Graphics> app(argc, argv); Nz::Application<Nz::Graphics> app(argc, argv);
// Création de la fenêtre // Création de la fenêtre
auto& windowing = app.AddComponent<Nz::AppWindowingComponent>(); auto& windowing = app.AddComponent<Nz::WindowingAppComponent>();
Nz::Window& mainWindow = windowing.CreateWindow(Nz::VideoMode(1280, 720), "Tut02 - Events"); Nz::Window& mainWindow = windowing.CreateWindow(Nz::VideoMode(1280, 720), "Tut02 - Events");
// Ajout d'un monde // Ajout d'un monde
auto& ecs = app.AddComponent<Nz::AppEntitySystemComponent>(); auto& ecs = app.AddComponent<Nz::EntitySystemAppComponent>();
auto& world = ecs.AddWorld<Nz::EnttWorld>(); auto& world = ecs.AddWorld<Nz::EnttWorld>();
Nz::RenderSystem& renderSystem = world.AddSystem<Nz::RenderSystem>(); Nz::RenderSystem& renderSystem = world.AddSystem<Nz::RenderSystem>();

View File

@ -16,13 +16,13 @@ int main(int argc, char* argv[])
{ {
Nz::Application<Nz::Graphics, Nz::Widgets> app(argc, argv); Nz::Application<Nz::Graphics, Nz::Widgets> app(argc, argv);
auto& windowing = app.AddComponent<Nz::AppWindowingComponent>(); auto& windowing = app.AddComponent<Nz::WindowingAppComponent>();
Nz::Window& mainWindow = windowing.CreateWindow(Nz::VideoMode(1920, 1080), "Widget demo"); Nz::Window& mainWindow = windowing.CreateWindow(Nz::VideoMode(1920, 1080), "Widget demo");
auto& ecs = app.AddComponent<Nz::AppEntitySystemComponent>(); auto& ecs = app.AddComponent<Nz::EntitySystemAppComponent>();
auto& world = ecs.AddWorld<Nz::EnttWorld>(); auto& world = ecs.AddWorld<Nz::EnttWorld>();
auto& fs = app.AddComponent<Nz::AppFilesystemComponent>(); auto& fs = app.AddComponent<Nz::FilesystemAppComponent>();
{ {
std::filesystem::path resourceDir = "assets/examples"; std::filesystem::path resourceDir = "assets/examples";
if (!std::filesystem::is_directory(resourceDir) && std::filesystem::is_directory("../.." / resourceDir)) if (!std::filesystem::is_directory(resourceDir) && std::filesystem::is_directory("../.." / resourceDir))

View File

@ -32,7 +32,6 @@
#include <Nazara/Core/AbstractHash.hpp> #include <Nazara/Core/AbstractHash.hpp>
#include <Nazara/Core/AbstractLogger.hpp> #include <Nazara/Core/AbstractLogger.hpp>
#include <Nazara/Core/Algorithm.hpp> #include <Nazara/Core/Algorithm.hpp>
#include <Nazara/Core/AppFilesystemComponent.hpp>
#include <Nazara/Core/Application.hpp> #include <Nazara/Core/Application.hpp>
#include <Nazara/Core/ApplicationBase.hpp> #include <Nazara/Core/ApplicationBase.hpp>
#include <Nazara/Core/ApplicationComponent.hpp> #include <Nazara/Core/ApplicationComponent.hpp>
@ -48,6 +47,7 @@
#include <Nazara/Core/Core.hpp> #include <Nazara/Core/Core.hpp>
#include <Nazara/Core/DynLib.hpp> #include <Nazara/Core/DynLib.hpp>
#include <Nazara/Core/EmptyStream.hpp> #include <Nazara/Core/EmptyStream.hpp>
#include <Nazara/Core/EntitySystemAppComponent.hpp>
#include <Nazara/Core/EntityWorld.hpp> #include <Nazara/Core/EntityWorld.hpp>
#include <Nazara/Core/Enums.hpp> #include <Nazara/Core/Enums.hpp>
#include <Nazara/Core/EnvironmentVariables.hpp> #include <Nazara/Core/EnvironmentVariables.hpp>
@ -55,6 +55,7 @@
#include <Nazara/Core/ErrorFlags.hpp> #include <Nazara/Core/ErrorFlags.hpp>
#include <Nazara/Core/File.hpp> #include <Nazara/Core/File.hpp>
#include <Nazara/Core/FileLogger.hpp> #include <Nazara/Core/FileLogger.hpp>
#include <Nazara/Core/FilesystemAppComponent.hpp>
#include <Nazara/Core/Format.hpp> #include <Nazara/Core/Format.hpp>
#include <Nazara/Core/Functor.hpp> #include <Nazara/Core/Functor.hpp>
#include <Nazara/Core/GuillotineBinPack.hpp> #include <Nazara/Core/GuillotineBinPack.hpp>
@ -103,7 +104,6 @@
#ifdef NAZARA_ENTT #ifdef NAZARA_ENTT
#include <Nazara/Core/AppEntitySystemComponent.hpp>
#include <Nazara/Core/Components.hpp> #include <Nazara/Core/Components.hpp>
#include <Nazara/Core/EnttSystemGraph.hpp> #include <Nazara/Core/EnttSystemGraph.hpp>
#include <Nazara/Core/EnttWorld.hpp> #include <Nazara/Core/EnttWorld.hpp>

View File

@ -4,8 +4,8 @@
#pragma once #pragma once
#ifndef NAZARA_CORE_APPENTITYSYSTEMCOMPONENT_HPP #ifndef NAZARA_CORE_ENTITYSYSTEMAPPCOMPONENT_HPP
#define NAZARA_CORE_APPENTITYSYSTEMCOMPONENT_HPP #define NAZARA_CORE_ENTITYSYSTEMAPPCOMPONENT_HPP
#include <NazaraUtils/Prerequisites.hpp> #include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Core/ApplicationComponent.hpp> #include <Nazara/Core/ApplicationComponent.hpp>
@ -14,26 +14,26 @@
namespace Nz namespace Nz
{ {
class NAZARA_CORE_API AppEntitySystemComponent : public ApplicationComponent class NAZARA_CORE_API EntitySystemAppComponent : public ApplicationComponent
{ {
public: public:
using ApplicationComponent::ApplicationComponent; using ApplicationComponent::ApplicationComponent;
AppEntitySystemComponent(const AppEntitySystemComponent&) = delete; EntitySystemAppComponent(const EntitySystemAppComponent&) = delete;
AppEntitySystemComponent(AppEntitySystemComponent&&) = delete; EntitySystemAppComponent(EntitySystemAppComponent&&) = delete;
~AppEntitySystemComponent() = default; ~EntitySystemAppComponent() = default;
template<typename T, typename... Args> T& AddWorld(Args&&... args); template<typename T, typename... Args> T& AddWorld(Args&&... args);
void Update(Time elapsedTime) override; void Update(Time elapsedTime) override;
AppEntitySystemComponent& operator=(const AppEntitySystemComponent&) = delete; EntitySystemAppComponent& operator=(const EntitySystemAppComponent&) = delete;
AppEntitySystemComponent& operator=(AppEntitySystemComponent&&) = delete; EntitySystemAppComponent& operator=(EntitySystemAppComponent&&) = delete;
private: private:
std::vector<std::unique_ptr<EntityWorld>> m_worlds; std::vector<std::unique_ptr<EntityWorld>> m_worlds;
}; };
} }
#include <Nazara/Core/AppEntitySystemComponent.inl> #include <Nazara/Core/EntitySystemAppComponent.inl>
#endif // NAZARA_CORE_APPENTITYSYSTEMCOMPONENT_HPP #endif // NAZARA_CORE_ENTITYSYSTEMAPPCOMPONENT_HPP

View File

@ -7,7 +7,7 @@
namespace Nz namespace Nz
{ {
template<typename T, typename... Args> template<typename T, typename... Args>
T& AppEntitySystemComponent::AddWorld(Args&&... args) T& EntitySystemAppComponent::AddWorld(Args&&... args)
{ {
return static_cast<T&>(*m_worlds.emplace_back(std::make_unique<T>(std::forward<Args>(args)...))); return static_cast<T&>(*m_worlds.emplace_back(std::make_unique<T>(std::forward<Args>(args)...)));
} }

View File

@ -4,8 +4,8 @@
#pragma once #pragma once
#ifndef NAZARA_CORE_APPFILESYSTEMCOMPONENT_HPP #ifndef NAZARA_CORE_FILESYSTEMAPPCOMPONENT_HPP
#define NAZARA_CORE_APPFILESYSTEMCOMPONENT_HPP #define NAZARA_CORE_FILESYSTEMAPPCOMPONENT_HPP
#include <NazaraUtils/Prerequisites.hpp> #include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Core/ApplicationComponent.hpp> #include <Nazara/Core/ApplicationComponent.hpp>
@ -17,13 +17,13 @@
namespace Nz namespace Nz
{ {
class NAZARA_CORE_API AppFilesystemComponent : public ApplicationComponent class NAZARA_CORE_API FilesystemAppComponent : public ApplicationComponent
{ {
public: public:
inline AppFilesystemComponent(ApplicationBase& app); inline FilesystemAppComponent(ApplicationBase& app);
AppFilesystemComponent(const AppFilesystemComponent&) = delete; FilesystemAppComponent(const FilesystemAppComponent&) = delete;
AppFilesystemComponent(AppFilesystemComponent&&) = delete; FilesystemAppComponent(FilesystemAppComponent&&) = delete;
~AppFilesystemComponent() = default; ~FilesystemAppComponent() = default;
template<typename T> const typename T::Params* GetDefaultResourceParameters() const; template<typename T> const typename T::Params* GetDefaultResourceParameters() const;
inline VirtualDirectoryPtr GetDirectory(std::string_view assetPath); inline VirtualDirectoryPtr GetDirectory(std::string_view assetPath);
@ -41,8 +41,8 @@ namespace Nz
template<typename T> void SetDefaultResourceParameters(typename T::Params params); template<typename T> void SetDefaultResourceParameters(typename T::Params params);
AppFilesystemComponent& operator=(const AppFilesystemComponent&) = delete; FilesystemAppComponent& operator=(const FilesystemAppComponent&) = delete;
AppFilesystemComponent& operator=(AppFilesystemComponent&&) = delete; FilesystemAppComponent& operator=(FilesystemAppComponent&&) = delete;
private: private:
template<typename T, typename... ExtraArgs> std::shared_ptr<T> LoadImpl(std::string_view assetPath, const typename T::Params& params, ExtraArgs&&... args); template<typename T, typename... ExtraArgs> std::shared_ptr<T> LoadImpl(std::string_view assetPath, const typename T::Params& params, ExtraArgs&&... args);
@ -53,6 +53,6 @@ namespace Nz
}; };
} }
#include <Nazara/Core/AppFilesystemComponent.inl> #include <Nazara/Core/FilesystemAppComponent.inl>
#endif // NAZARA_CORE_APPFILESYSTEMCOMPONENT_HPP #endif // NAZARA_CORE_FILESYSTEMAPPCOMPONENT_HPP

View File

@ -19,13 +19,13 @@ namespace Nz
struct ResourceParameterHasMerge<T, std::void_t<decltype(std::declval<T>().Merge(std::declval<T>()))>> : std::true_type {}; struct ResourceParameterHasMerge<T, std::void_t<decltype(std::declval<T>().Merge(std::declval<T>()))>> : std::true_type {};
} }
inline AppFilesystemComponent::AppFilesystemComponent(ApplicationBase& app) : inline FilesystemAppComponent::FilesystemAppComponent(ApplicationBase& app) :
ApplicationComponent(app) ApplicationComponent(app)
{ {
} }
template<typename T> template<typename T>
const typename T::Params* AppFilesystemComponent::GetDefaultResourceParameters() const const typename T::Params* FilesystemAppComponent::GetDefaultResourceParameters() const
{ {
constexpr UInt64 typeHash = FNV1a64(TypeName<T>()); constexpr UInt64 typeHash = FNV1a64(TypeName<T>());
@ -36,7 +36,7 @@ namespace Nz
return static_cast<const typename T::Params*>(it->second.get()); return static_cast<const typename T::Params*>(it->second.get());
} }
VirtualDirectoryPtr AppFilesystemComponent::GetDirectory(std::string_view assetPath) VirtualDirectoryPtr FilesystemAppComponent::GetDirectory(std::string_view assetPath)
{ {
VirtualDirectoryPtr dir; VirtualDirectoryPtr dir;
m_rootDirectory->GetDirectoryEntry(assetPath, [&](const Nz::VirtualDirectory::DirectoryEntry& dirEntry) m_rootDirectory->GetDirectoryEntry(assetPath, [&](const Nz::VirtualDirectory::DirectoryEntry& dirEntry)
@ -48,13 +48,13 @@ namespace Nz
} }
template<typename T, typename... ExtraArgs> template<typename T, typename... ExtraArgs>
std::shared_ptr<T> AppFilesystemComponent::Load(std::string_view assetPath, ExtraArgs&&... args) std::shared_ptr<T> FilesystemAppComponent::Load(std::string_view assetPath, ExtraArgs&&... args)
{ {
return Load<T>(assetPath, typename T::Params{}, std::forward<ExtraArgs>(args)...); return Load<T>(assetPath, typename T::Params{}, std::forward<ExtraArgs>(args)...);
} }
template<typename T, typename... ExtraArgs> template<typename T, typename... ExtraArgs>
std::shared_ptr<T> AppFilesystemComponent::Load(std::string_view assetPath, typename T::Params params, ExtraArgs&&... args) std::shared_ptr<T> FilesystemAppComponent::Load(std::string_view assetPath, typename T::Params params, ExtraArgs&&... args)
{ {
if constexpr (Detail::ResourceParameterHasMerge<typename T::Params>::value) if constexpr (Detail::ResourceParameterHasMerge<typename T::Params>::value)
{ {
@ -66,13 +66,13 @@ namespace Nz
} }
template<typename T, typename... ExtraArgs> template<typename T, typename... ExtraArgs>
std::shared_ptr<T> AppFilesystemComponent::Open(std::string_view assetPath, ExtraArgs&&... args) std::shared_ptr<T> FilesystemAppComponent::Open(std::string_view assetPath, ExtraArgs&&... args)
{ {
return Open<T>(assetPath, typename T::Params{}, std::forward<ExtraArgs>(args)...); return Open<T>(assetPath, typename T::Params{}, std::forward<ExtraArgs>(args)...);
} }
template<typename T, typename... ExtraArgs> template<typename T, typename... ExtraArgs>
std::shared_ptr<T> AppFilesystemComponent::Open(std::string_view assetPath, typename T::Params params, ExtraArgs&&... args) std::shared_ptr<T> FilesystemAppComponent::Open(std::string_view assetPath, typename T::Params params, ExtraArgs&&... args)
{ {
if constexpr (Detail::ResourceParameterHasMerge<typename T::Params>::value) if constexpr (Detail::ResourceParameterHasMerge<typename T::Params>::value)
{ {
@ -84,7 +84,7 @@ namespace Nz
} }
template<typename T> template<typename T>
void AppFilesystemComponent::SetDefaultResourceParameters(typename T::Params params) void FilesystemAppComponent::SetDefaultResourceParameters(typename T::Params params)
{ {
constexpr UInt64 typeHash = FNV1a64(TypeName<T>()); constexpr UInt64 typeHash = FNV1a64(TypeName<T>());
@ -92,7 +92,7 @@ namespace Nz
} }
template<typename T, typename... ExtraArgs> template<typename T, typename... ExtraArgs>
std::shared_ptr<T> AppFilesystemComponent::LoadImpl(std::string_view assetPath, const typename T::Params& params, ExtraArgs&&... args) std::shared_ptr<T> FilesystemAppComponent::LoadImpl(std::string_view assetPath, const typename T::Params& params, ExtraArgs&&... args)
{ {
std::shared_ptr<T> resource; std::shared_ptr<T> resource;
if (!m_rootDirectory) if (!m_rootDirectory)
@ -123,7 +123,7 @@ namespace Nz
} }
template<typename T, typename... ExtraArgs> template<typename T, typename... ExtraArgs>
std::shared_ptr<T> AppFilesystemComponent::OpenImpl(std::string_view assetPath, const typename T::Params& params, ExtraArgs&&... args) std::shared_ptr<T> FilesystemAppComponent::OpenImpl(std::string_view assetPath, const typename T::Params& params, ExtraArgs&&... args)
{ {
std::shared_ptr<T> resource; std::shared_ptr<T> resource;
if (!m_rootDirectory) if (!m_rootDirectory)

View File

@ -25,8 +25,8 @@
namespace Nz namespace Nz
{ {
class AppFilesystemComponent;
class CommandLineParameters; class CommandLineParameters;
class FilesystemAppComponent;
class RenderBuffer; class RenderBuffer;
class NAZARA_GRAPHICS_API Graphics : public ModuleBase<Graphics> class NAZARA_GRAPHICS_API Graphics : public ModuleBase<Graphics>
@ -68,7 +68,7 @@ namespace Nz
inline std::shared_ptr<nzsl::FilesystemModuleResolver>& GetShaderModuleResolver(); inline std::shared_ptr<nzsl::FilesystemModuleResolver>& GetShaderModuleResolver();
inline const std::shared_ptr<nzsl::FilesystemModuleResolver>& GetShaderModuleResolver() const; inline const std::shared_ptr<nzsl::FilesystemModuleResolver>& GetShaderModuleResolver() const;
void RegisterComponent(AppFilesystemComponent& component); void RegisterComponent(FilesystemAppComponent& component);
struct NAZARA_GRAPHICS_API Config struct NAZARA_GRAPHICS_API Config
{ {

View File

@ -29,7 +29,6 @@
#ifndef NAZARA_GLOBAL_PLATFORM_HPP #ifndef NAZARA_GLOBAL_PLATFORM_HPP
#define NAZARA_GLOBAL_PLATFORM_HPP #define NAZARA_GLOBAL_PLATFORM_HPP
#include <Nazara/Platform/AppWindowingComponent.hpp>
#include <Nazara/Platform/Clipboard.hpp> #include <Nazara/Platform/Clipboard.hpp>
#include <Nazara/Platform/Config.hpp> #include <Nazara/Platform/Config.hpp>
#include <Nazara/Platform/Cursor.hpp> #include <Nazara/Platform/Cursor.hpp>
@ -45,5 +44,6 @@
#include <Nazara/Platform/WindowEvent.hpp> #include <Nazara/Platform/WindowEvent.hpp>
#include <Nazara/Platform/WindowEventHandler.hpp> #include <Nazara/Platform/WindowEventHandler.hpp>
#include <Nazara/Platform/WindowHandle.hpp> #include <Nazara/Platform/WindowHandle.hpp>
#include <Nazara/Platform/WindowingAppComponent.hpp>
#endif // NAZARA_GLOBAL_PLATFORM_HPP #endif // NAZARA_GLOBAL_PLATFORM_HPP

View File

@ -4,8 +4,8 @@
#pragma once #pragma once
#ifndef NAZARA_PLATFORM_APPWINDOWINGCOMPONENT_HPP #ifndef NAZARA_PLATFORM_WINDOWINGAPPCOMPONENT_HPP
#define NAZARA_PLATFORM_APPWINDOWINGCOMPONENT_HPP #define NAZARA_PLATFORM_WINDOWINGAPPCOMPONENT_HPP
#include <NazaraUtils/Prerequisites.hpp> #include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Core/ApplicationComponent.hpp> #include <Nazara/Core/ApplicationComponent.hpp>
@ -14,13 +14,13 @@
namespace Nz namespace Nz
{ {
class NAZARA_PLATFORM_API AppWindowingComponent : public ApplicationComponent class NAZARA_PLATFORM_API WindowingAppComponent : public ApplicationComponent
{ {
public: public:
inline AppWindowingComponent(ApplicationBase& app); inline WindowingAppComponent(ApplicationBase& app);
AppWindowingComponent(const AppWindowingComponent&) = delete; WindowingAppComponent(const WindowingAppComponent&) = delete;
AppWindowingComponent(AppWindowingComponent&&) = delete; WindowingAppComponent(WindowingAppComponent&&) = delete;
~AppWindowingComponent() = default; ~WindowingAppComponent() = default;
template<typename... Args> Window& CreateWindow(Args&&... args); template<typename... Args> Window& CreateWindow(Args&&... args);
@ -31,8 +31,8 @@ namespace Nz
void Update(Time elapsedTime) override; void Update(Time elapsedTime) override;
AppWindowingComponent& operator=(const AppWindowingComponent&) = delete; WindowingAppComponent& operator=(const WindowingAppComponent&) = delete;
AppWindowingComponent& operator=(AppWindowingComponent&&) = delete; WindowingAppComponent& operator=(WindowingAppComponent&&) = delete;
private: private:
std::vector<std::unique_ptr<Window>> m_windows; std::vector<std::unique_ptr<Window>> m_windows;
@ -40,6 +40,6 @@ namespace Nz
}; };
} }
#include <Nazara/Platform/AppWindowingComponent.inl> #include <Nazara/Platform/WindowingAppComponent.inl>
#endif // NAZARA_PLATFORM_APPWINDOWINGCOMPONENT_HPP #endif // NAZARA_PLATFORM_WINDOWINGAPPCOMPONENT_HPP

View File

@ -7,28 +7,28 @@
namespace Nz namespace Nz
{ {
template<typename... Args> template<typename... Args>
Window& AppWindowingComponent::CreateWindow(Args&&... args) Window& WindowingAppComponent::CreateWindow(Args&&... args)
{ {
return *m_windows.emplace_back(std::make_unique<Window>(std::forward<Args>(args)...)); return *m_windows.emplace_back(std::make_unique<Window>(std::forward<Args>(args)...));
} }
inline AppWindowingComponent::AppWindowingComponent(ApplicationBase& app) : inline WindowingAppComponent::WindowingAppComponent(ApplicationBase& app) :
ApplicationComponent(app), ApplicationComponent(app),
m_quitOnLastWindowClosed(true) m_quitOnLastWindowClosed(true)
{ {
} }
inline void AppWindowingComponent::DisableQuitOnLastWindowClosed() inline void WindowingAppComponent::DisableQuitOnLastWindowClosed()
{ {
return EnableQuitOnLastWindowClosed(false); return EnableQuitOnLastWindowClosed(false);
} }
inline void AppWindowingComponent::EnableQuitOnLastWindowClosed(bool enable) inline void WindowingAppComponent::EnableQuitOnLastWindowClosed(bool enable)
{ {
m_quitOnLastWindowClosed = enable; m_quitOnLastWindowClosed = enable;
} }
inline bool AppWindowingComponent::IsQuitOnLastWindowClosedEnabled() const inline bool WindowingAppComponent::IsQuitOnLastWindowClosedEnabled() const
{ {
return m_quitOnLastWindowClosed; return m_quitOnLastWindowClosed;
} }

View File

@ -2,12 +2,12 @@
// This file is part of the "Nazara Engine - Core module" // This file is part of the "Nazara Engine - Core module"
// For conditions of distribution and use, see copyright notice in Config.hpp // For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Core/AppEntitySystemComponent.hpp> #include <Nazara/Core/EntitySystemAppComponent.hpp>
#include <Nazara/Core/Debug.hpp> #include <Nazara/Core/Debug.hpp>
namespace Nz namespace Nz
{ {
void AppEntitySystemComponent::Update(Time elapsedTime) void EntitySystemAppComponent::Update(Time elapsedTime)
{ {
for (auto& worldPtr : m_worlds) for (auto& worldPtr : m_worlds)
worldPtr->Update(elapsedTime); worldPtr->Update(elapsedTime);

View File

@ -2,18 +2,18 @@
// This file is part of the "Nazara Engine - Core module" // This file is part of the "Nazara Engine - Core module"
// For conditions of distribution and use, see copyright notice in Config.hpp // For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Core/AppFilesystemComponent.hpp> #include <Nazara/Core/FilesystemAppComponent.hpp>
#include <Nazara/Core/VirtualDirectoryFilesystemResolver.hpp> #include <Nazara/Core/VirtualDirectoryFilesystemResolver.hpp>
#include <Nazara/Core/Debug.hpp> #include <Nazara/Core/Debug.hpp>
namespace Nz namespace Nz
{ {
const VirtualDirectoryPtr& AppFilesystemComponent::Mount(std::string_view name, std::filesystem::path filepath) const VirtualDirectoryPtr& FilesystemAppComponent::Mount(std::string_view name, std::filesystem::path filepath)
{ {
return Mount(name, std::make_shared<VirtualDirectory>(std::make_shared<VirtualDirectoryFilesystemResolver>(std::move(filepath)))); return Mount(name, std::make_shared<VirtualDirectory>(std::make_shared<VirtualDirectoryFilesystemResolver>(std::move(filepath))));
} }
const VirtualDirectoryPtr& AppFilesystemComponent::Mount(std::string_view name, VirtualDirectoryPtr directory) const VirtualDirectoryPtr& FilesystemAppComponent::Mount(std::string_view name, VirtualDirectoryPtr directory)
{ {
if (name.empty()) if (name.empty())
{ {
@ -27,7 +27,7 @@ namespace Nz
return m_rootDirectory->StoreDirectory(name, std::move(directory)).directory; return m_rootDirectory->StoreDirectory(name, std::move(directory)).directory;
} }
void AppFilesystemComponent::MountDefaultDirectories() void FilesystemAppComponent::MountDefaultDirectories()
{ {
m_rootDirectory = std::make_shared<VirtualDirectory>(std::make_shared<VirtualDirectoryFilesystemResolver>(std::filesystem::current_path())); m_rootDirectory = std::make_shared<VirtualDirectory>(std::make_shared<VirtualDirectoryFilesystemResolver>(std::filesystem::current_path()));
} }

View File

@ -3,9 +3,9 @@
// For conditions of distribution and use, see copyright notice in Config.hpp // For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Graphics/Graphics.hpp> #include <Nazara/Graphics/Graphics.hpp>
#include <Nazara/Core/AppFilesystemComponent.hpp>
#include <Nazara/Core/CommandLineParameters.hpp> #include <Nazara/Core/CommandLineParameters.hpp>
#include <Nazara/Core/EnvironmentVariables.hpp> #include <Nazara/Core/EnvironmentVariables.hpp>
#include <Nazara/Core/FilesystemAppComponent.hpp>
#include <Nazara/Graphics/DebugDrawPipelinePass.hpp> #include <Nazara/Graphics/DebugDrawPipelinePass.hpp>
#include <Nazara/Graphics/DepthPipelinePass.hpp> #include <Nazara/Graphics/DepthPipelinePass.hpp>
#include <Nazara/Graphics/ForwardPipelinePass.hpp> #include <Nazara/Graphics/ForwardPipelinePass.hpp>
@ -205,7 +205,7 @@ namespace Nz
m_defaultTextures = DefaultTextures{}; m_defaultTextures = DefaultTextures{};
} }
void Graphics::RegisterComponent(AppFilesystemComponent& component) void Graphics::RegisterComponent(FilesystemAppComponent& component)
{ {
TextureParams defaultTexParams; TextureParams defaultTexParams;
defaultTexParams.renderDevice = m_renderDevice; defaultTexParams.renderDevice = m_renderDevice;

View File

@ -2,13 +2,13 @@
// This file is part of the "Nazara Engine - Platform module" // This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp // For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Platform/AppWindowingComponent.hpp> #include <Nazara/Platform/WindowingAppComponent.hpp>
#include <Nazara/Core/ApplicationBase.hpp> #include <Nazara/Core/ApplicationBase.hpp>
#include <Nazara/Platform/Debug.hpp> #include <Nazara/Platform/Debug.hpp>
namespace Nz namespace Nz
{ {
void AppWindowingComponent::Update(Time /*elapsedTime*/) void WindowingAppComponent::Update(Time /*elapsedTime*/)
{ {
Window::ProcessEvents(); Window::ProcessEvents();

View File

@ -26,7 +26,7 @@ int main()
#endif #endif
Nz::Application<Nz::Graphics> app(rendererConfig); Nz::Application<Nz::Graphics> app(rendererConfig);
auto& windowingApp = app.AddComponent<Nz::AppWindowingComponent>(); auto& windowingApp = app.AddComponent<Nz::WindowingAppComponent>();
std::shared_ptr<Nz::RenderDevice> device = Nz::Graphics::Instance()->GetRenderDevice(); std::shared_ptr<Nz::RenderDevice> device = Nz::Graphics::Instance()->GetRenderDevice();

View File

@ -20,9 +20,9 @@ int main()
Nz::Application<Nz::Graphics> app(rendererConfig); Nz::Application<Nz::Graphics> app(rendererConfig);
auto& windowing = app.AddComponent<Nz::AppWindowingComponent>(); auto& windowing = app.AddComponent<Nz::WindowingAppComponent>();
auto& ecs = app.AddComponent<Nz::AppEntitySystemComponent>(); auto& ecs = app.AddComponent<Nz::EntitySystemAppComponent>();
auto& world = ecs.AddWorld<Nz::EnttWorld>(); auto& world = ecs.AddWorld<Nz::EnttWorld>();
Nz::RenderSystem& renderSystem = world.AddSystem<Nz::RenderSystem>(); Nz::RenderSystem& renderSystem = world.AddSystem<Nz::RenderSystem>();

View File

@ -97,7 +97,7 @@ int main()
#endif #endif
Nz::Application<Nz::Renderer> app(rendererConfig); Nz::Application<Nz::Renderer> app(rendererConfig);
auto& windowingApp = app.AddComponent<Nz::AppWindowingComponent>(); auto& windowingApp = app.AddComponent<Nz::WindowingAppComponent>();
std::shared_ptr<Nz::RenderDevice> device = Nz::Renderer::Instance()->InstanciateRenderDevice(0); std::shared_ptr<Nz::RenderDevice> device = Nz::Renderer::Instance()->InstanciateRenderDevice(0);