diff --git a/examples/Tut01/main.cpp b/examples/Tut01/main.cpp index 2feae9d29..2bb54a579 100644 --- a/examples/Tut01/main.cpp +++ b/examples/Tut01/main.cpp @@ -9,6 +9,7 @@ int main() { + // Mise en place de l'application, de la fenêtre et du monde Nz::Application app; auto& windowing = app.AddComponent(); @@ -20,16 +21,20 @@ int main() auto& renderSystem = world.AddSystem(); Nz::WindowSwapchain& windowSwapchain = renderSystem.CreateSwapchain(mainWindow); + // Création de la caméra entt::handle cameraEntity = world.CreateEntity(); - cameraEntity.emplace(); + { + cameraEntity.emplace(); - auto& cameraComponent = cameraEntity.emplace(&windowSwapchain, Nz::ProjectionType::Orthographic); - cameraComponent.UpdateClearColor(Nz::Color(0.f, 0.f, 0.f, 1.f)); + auto& cameraComponent = cameraEntity.emplace(&windowSwapchain, Nz::ProjectionType::Orthographic); + cameraComponent.UpdateClearColor(Nz::Color(0.46f, 0.48f, 0.84f, 1.f)); + } + // Création d'un texte Nz::SimpleTextDrawer textDrawer; + textDrawer.SetText("Hello world !"); textDrawer.SetCharacterSize(72); textDrawer.SetOutlineThickness(4.f); - textDrawer.SetText("Hello world !"); std::shared_ptr textSprite = std::make_shared(); textSprite->Update(textDrawer); @@ -37,6 +42,7 @@ int main() entt::handle textEntity = world.CreateEntity(); { auto& nodeComponent = textEntity.emplace(); + auto& gfxComponent = textEntity.emplace(); gfxComponent.AttachRenderable(textSprite);