diff --git a/lib/wal/sources/Wal.hpp b/lib/wal/sources/Wal.hpp index c7c02e9d..036c1787 100644 --- a/lib/wal/sources/Wal.hpp +++ b/lib/wal/sources/Wal.hpp @@ -20,7 +20,7 @@ namespace WAL //! @brief The main WAL class, it is used to setup and run the ECS. class Wal { - private: + public: //! @brief The scene manager that allow multiple scene to work together. Scene _scene; //! @brief The list of registered systems diff --git a/sources/System/Renderer/RenderScreenSystem.hpp b/sources/System/Renderer/RenderScreenSystem.hpp index bcb83a13..9549133d 100644 --- a/sources/System/Renderer/RenderScreenSystem.hpp +++ b/sources/System/Renderer/RenderScreenSystem.hpp @@ -30,7 +30,6 @@ namespace BBM //! @note render on screen here void onSelfUpdate() override { - std::cout << "render" << std::endl; this->_window.unuseCamera(); this->_window.setDrawingState(RAY::Window::IDLE); this->_camera.update(); diff --git a/sources/System/Renderer/Renderer3DSystem.hpp b/sources/System/Renderer/Renderer3DSystem.hpp index 099a7c57..bb345b42 100644 --- a/sources/System/Renderer/Renderer3DSystem.hpp +++ b/sources/System/Renderer/Renderer3DSystem.hpp @@ -32,7 +32,6 @@ namespace BBM //! @param dtime The delta time. void onUpdate(WAL::Entity &entity, std::chrono::nanoseconds) override { - std::cout << "Drawing: " << typeid(T).name() << std::endl; auto &comp = entity.getComponent>(); auto &pos = entity.getComponent(); diff --git a/sources/main.cpp b/sources/main.cpp index f6041ccd..59318fc1 100644 --- a/sources/main.cpp +++ b/sources/main.cpp @@ -17,6 +17,8 @@ #include "Drawables/3D/Grid.hpp" #include "Drawables/Texture.hpp" #include "Drawables/3D/Circle.hpp" +#include "Drawables/3D/Cube.hpp" +#include "Drawables/3D/Sphere.hpp" #include "Model/Model.hpp" #include "Model/ModelAnimations.hpp" #include "System/Renderer/Renderer3DSystem.hpp" @@ -56,18 +58,24 @@ int demo() 45.0f, CAMERA_PERSPECTIVE ); WAL::Entity entityPlayer("roger"); - RAY::Drawables::Drawables3D::Circle circle({30, 30, 30}, 50, 0XFFFFFFF, {0, 0, 0}, 0); + RAY::Drawables::Drawables3D::Circle circle({0, 0, 0}, 5, MAROON, {0, 0, 0}, 0); + RAY::Drawables::Drawables3D::Cube cube({0, 0, 0}, {2, 2, 2}, BLUE); BBM::Drawable3DComponent circleComponent(entityPlayer, circle); - BBM::PositionComponent posComponent(entityPlayer, {20, 20, 20}); + BBM::Drawable3DComponent cubeComponent(entityPlayer, cube); + BBM::PositionComponent posComponent(entityPlayer, {0, 0, 0}); BBM::Renderer3DSystem circleSystem(window); + BBM::Renderer3DSystem cubeSystem(window); BBM::RenderScreenSystem renderSystem(window, camera); wal.addSystem(circleSystem); wal.addSystem(renderSystem); + wal.addSystem(cubeSystem); entityPlayer.addComponent(circleComponent); + entityPlayer.addComponent(cubeComponent); entityPlayer.addComponent(posComponent); + wal._scene.addEntity(entityPlayer); camera.setMode(CAMERA_FREE); // Set free camera mode @@ -78,8 +86,9 @@ int demo() window.close(); - /* - * const int screenWidth = 800; + +/* + const int screenWidth = 800; const int screenHeight = 450; auto iterator = textures.begin(); const std::string modelPath = "assets/player/player.obj"; @@ -96,7 +105,7 @@ int demo() 45.0f, CAMERA_PERSPECTIVE ); WAL::Entity entityPlayer("roger"); - RAY::Drawables::Drawables3D::Circle circle({300, 300, 300}, 50, 0XFFFFFFF, {0, 0, 0}, 0); + RAY::Drawables::Drawables3D::Circle circle({0, 0, 0}, 5, MAROON, {0, 0, 0}, 0); BBM::Drawable3DComponent circleComponent(entityPlayer, circle); BBM::Renderer3DSystem circleSystem(window); @@ -137,13 +146,14 @@ int demo() window.useCamera(camera); window.draw(model, position, RAY::Vector3(1.0f, 20, 0.0f), -180.0f, RAY::Vector3( 5.0f, 5.0f, 5.0f )); window.draw(grid); + window.draw(circle); window.unuseCamera(); window.draw(instructionText); window.setDrawingState(RAY::Window::IDLE); } - +*/ window.close(); - */ + return 0; }