diff --git a/examples/DeferredShading/main.cpp b/examples/DeferredShading/main.cpp index 1ee4c8792..dd1b665c7 100644 --- a/examples/DeferredShading/main.cpp +++ b/examples/DeferredShading/main.cpp @@ -65,7 +65,7 @@ struct SpotLight Nz::RadianAnglef outerAngle = Nz::DegreeAnglef(20.f); }; -int main() +int main(int argc, char* argv[]) { std::filesystem::path resourceDir = "assets/examples"; if (!std::filesystem::is_directory(resourceDir) && std::filesystem::is_directory("../.." / resourceDir)) @@ -75,7 +75,7 @@ int main() if (!std::filesystem::is_directory(shaderDir) && std::filesystem::is_directory("../.." / shaderDir)) shaderDir = "../.." / shaderDir; - Nz::Application app; + Nz::Application app(argc, argv); nzsl::ShaderWriter::States states; states.shaderModuleResolver = Nz::Graphics::Instance()->GetShaderModuleResolver(); @@ -343,9 +343,6 @@ int main() light.radius = radiusDis(randomEngine); } - unsigned int offscreenWidth = windowSize.x; - unsigned int offscreenHeight = windowSize.y; - // Bloom data Nz::RenderPipelineLayoutInfo fullscreenPipelineLayoutInfoViewer; @@ -1145,9 +1142,9 @@ int main() if (lightAnimation) elapsedTime += deltaTime; - if (std::optional deltaTime = updateClock.RestartIfOver(Nz::Time::TickDuration(60))) + if (std::optional movementDuration = updateClock.RestartIfOver(Nz::Time::TickDuration(60))) { - float cameraSpeed = 2.f * deltaTime->AsSeconds(); + float cameraSpeed = 2.f * movementDuration->AsSeconds(); if (Nz::Keyboard::IsKeyPressed(Nz::Keyboard::VKey::Up) || Nz::Keyboard::IsKeyPressed(Nz::Keyboard::VKey::Z)) viewerPos += camQuat * Nz::Vector3f::Forward() * cameraSpeed; diff --git a/examples/DopplerEffect/main.cpp b/examples/DopplerEffect/main.cpp index 778fdaef5..0d18e5f91 100644 --- a/examples/DopplerEffect/main.cpp +++ b/examples/DopplerEffect/main.cpp @@ -18,13 +18,13 @@ #include #include -int main() +int main(int argc, char* argv[]) { std::filesystem::path resourceDir = "assets/examples"; if (!std::filesystem::is_directory(resourceDir) && std::filesystem::is_directory("../.." / resourceDir)) resourceDir = "../.." / resourceDir; - Nz::Application app; + Nz::Application app(argc, argv); app.AddComponent(); Nz::Sound sound; diff --git a/examples/PhysicallyBasedRendering/main.cpp b/examples/PhysicallyBasedRendering/main.cpp index a9b4d3fa2..68956e09d 100644 --- a/examples/PhysicallyBasedRendering/main.cpp +++ b/examples/PhysicallyBasedRendering/main.cpp @@ -7,13 +7,13 @@ #include #include -int main() +int main(int argc, char* argv[]) { std::filesystem::path resourceDir = "assets/examples"; if (!std::filesystem::is_directory(resourceDir) && std::filesystem::is_directory("../.." / resourceDir)) resourceDir = "../.." / resourceDir; - Nz::Application app; + Nz::Application app(argc, argv); std::shared_ptr device = Nz::Graphics::Instance()->GetRenderDevice(); diff --git a/examples/Physics2DDemo/main.cpp b/examples/Physics2DDemo/main.cpp index 988e67834..031079e18 100644 --- a/examples/Physics2DDemo/main.cpp +++ b/examples/Physics2DDemo/main.cpp @@ -15,13 +15,13 @@ NAZARA_REQUEST_DEDICATED_GPU() -int main() +int main(int argc, char* argv[]) { std::filesystem::path resourceDir = "assets/examples"; if (!std::filesystem::is_directory(resourceDir) && std::filesystem::is_directory("../.." / resourceDir)) resourceDir = "../.." / resourceDir; - Nz::Application app; + Nz::Application app(argc, argv); auto& windowing = app.AddComponent(); diff --git a/examples/PhysicsDemo/main.cpp b/examples/PhysicsDemo/main.cpp index 8fa7e0231..b8cb1ac6c 100644 --- a/examples/PhysicsDemo/main.cpp +++ b/examples/PhysicsDemo/main.cpp @@ -14,13 +14,13 @@ NAZARA_REQUEST_DEDICATED_GPU() -int main() +int main(int argc, char* argv[]) { std::filesystem::path resourceDir = "assets/examples"; if (!std::filesystem::is_directory(resourceDir) && std::filesystem::is_directory("../.." / resourceDir)) resourceDir = "../.." / resourceDir; - Nz::Application app; + Nz::Application app(argc, argv); auto& windowing = app.AddComponent(); diff --git a/examples/PhysicsPlayground/main.cpp b/examples/PhysicsPlayground/main.cpp index 01028ebd9..6145ddbf6 100644 --- a/examples/PhysicsPlayground/main.cpp +++ b/examples/PhysicsPlayground/main.cpp @@ -17,7 +17,7 @@ constexpr float BoxDims = 16.f; -int main() +int main(int argc, char* argv[]) { try { // Mise en place de l'application, de la fenêtre et du monde @@ -25,9 +25,9 @@ int main() renderConfig.validationLevel = Nz::RenderAPIValidationLevel::None; #if USE_JOLT - Nz::Application app(renderConfig); + Nz::Application app(argc, argv, renderConfig); #else - Nz::Application app(renderConfig); + Nz::Application app(argc, argv, renderConfig); #endif auto& windowing = app.AddComponent(); diff --git a/examples/PlayMusic/main.cpp b/examples/PlayMusic/main.cpp index f00d9f5ed..a22f8f116 100644 --- a/examples/PlayMusic/main.cpp +++ b/examples/PlayMusic/main.cpp @@ -14,13 +14,13 @@ #include #include -int main() +int main(int argc, char* argv[]) { std::filesystem::path resourceDir = "assets/examples"; if (!std::filesystem::is_directory(resourceDir) && std::filesystem::is_directory("../.." / resourceDir)) resourceDir = "../.." / resourceDir; - Nz::Application app; + Nz::Application app(argc, argv); app.AddComponent(); Nz::SoundStreamParams streamParams; diff --git a/examples/Showcase/main.cpp b/examples/Showcase/main.cpp index 7c63f489e..209641cac 100644 --- a/examples/Showcase/main.cpp +++ b/examples/Showcase/main.cpp @@ -17,9 +17,9 @@ NAZARA_REQUEST_DEDICATED_GPU() -int main() +int main(int argc, char* argv[]) { - Nz::Application app; + Nz::Application app(argc, argv); Nz::PluginLoader loader; Nz::Plugin assimp = loader.Load(); @@ -223,7 +223,7 @@ int main() entt::handle lightEntity3 = world.CreateEntity(); { - auto& bobNode = bobEntity.emplace(); + [[maybe_unused]] auto& bobNode = bobEntity.emplace(); //bobNode.SetRotation(Nz::EulerAnglesf(-90.f, -90.f, 0.f)); //bobNode.SetScale(1.f / 40.f * 0.5f); //bobNode.SetPosition(Nz::Vector3f(0.f, -1.f, 0.f)); diff --git a/examples/Tut01/main.cpp b/examples/Tut01/main.cpp index 2bb54a579..0aeecb239 100644 --- a/examples/Tut01/main.cpp +++ b/examples/Tut01/main.cpp @@ -7,10 +7,10 @@ #include #include -int main() +int main(int argc, char* argv[]) { // Mise en place de l'application, de la fenêtre et du monde - Nz::Application app; + Nz::Application app(argc, argv); auto& windowing = app.AddComponent(); Nz::Window& mainWindow = windowing.CreateWindow(Nz::VideoMode(1280, 720), "Tut01 - Hello world"); diff --git a/examples/Tut02/main.cpp b/examples/Tut02/main.cpp index ffd391a4a..83a5ec2a6 100644 --- a/examples/Tut02/main.cpp +++ b/examples/Tut02/main.cpp @@ -7,9 +7,9 @@ #include #include -int main() +int main(int argc, char* argv[]) { - Nz::Application app; + Nz::Application app(argc, argv); // Création de la fenêtre auto& windowing = app.AddComponent(); diff --git a/examples/WebServices/main.cpp b/examples/WebServices/main.cpp index 70800f99f..5d9a6a7cc 100644 --- a/examples/WebServices/main.cpp +++ b/examples/WebServices/main.cpp @@ -2,9 +2,9 @@ #include #include -int main() +int main(int argc, char* argv[]) { - Nz::Application app; + Nz::Application app(argc, argv); std::unique_ptr webService = Nz::Network::Instance()->InstantiateWebService(); diff --git a/examples/WidgetDemo/main.cpp b/examples/WidgetDemo/main.cpp index 7baf44321..3e636bc08 100644 --- a/examples/WidgetDemo/main.cpp +++ b/examples/WidgetDemo/main.cpp @@ -12,9 +12,9 @@ NAZARA_REQUEST_DEDICATED_GPU() -int main() +int main(int argc, char* argv[]) { - Nz::Application app; + Nz::Application app(argc, argv); auto& windowing = app.AddComponent(); Nz::Window& mainWindow = windowing.CreateWindow(Nz::VideoMode(1920, 1080), "Widget demo");