From 78b4a0cc73de60fe76bd3d9b84f7905de26808b8 Mon Sep 17 00:00:00 2001 From: roby2014 Date: Tue, 10 Oct 2023 17:09:06 +0100 Subject: [PATCH] added base files --- engine/CMakeLists.txt | 1 + .../engine/tools/debug_camera/plugin.hpp | 18 +++++++++++++++ .../engine/tools/debug_camera/plugin.cpp | 22 +++++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 engine/include/cubos/engine/tools/debug_camera/plugin.hpp create mode 100644 engine/src/cubos/engine/tools/debug_camera/plugin.cpp diff --git a/engine/CMakeLists.txt b/engine/CMakeLists.txt index ae90b8b174..605fdae4e6 100644 --- a/engine/CMakeLists.txt +++ b/engine/CMakeLists.txt @@ -28,6 +28,7 @@ set(CUBOS_ENGINE_SOURCE "src/cubos/engine/tools/world_inspector/plugin.cpp" "src/cubos/engine/tools/entity_inspector/plugin.cpp" "src/cubos/engine/tools/scene_editor/plugin.cpp" + "src/cubos/engine/tools/debug_camera/plugin.cpp" "src/cubos/engine/transform/plugin.cpp" "src/cubos/engine/transform/local_to_world.cpp" diff --git a/engine/include/cubos/engine/tools/debug_camera/plugin.hpp b/engine/include/cubos/engine/tools/debug_camera/plugin.hpp new file mode 100644 index 0000000000..96e551fd59 --- /dev/null +++ b/engine/include/cubos/engine/tools/debug_camera/plugin.hpp @@ -0,0 +1,18 @@ +/// @dir +/// @brief @ref debug-camera-plugin plugin directory. + +/// @file +/// @brief Plugin entry point. +/// @ingroup debug-camera-plugin + +#pragma once + +#include + +namespace cubos::engine::tools +{ + /// @brief Plugin entry function. + /// @param cubos @b CUBOS. main class + /// @ingroup debug-camera-plugin + void debugCameraPlugin(Cubos& cubos); +} // namespace cubos::engine::tools diff --git a/engine/src/cubos/engine/tools/debug_camera/plugin.cpp b/engine/src/cubos/engine/tools/debug_camera/plugin.cpp new file mode 100644 index 0000000000..2f53f0516d --- /dev/null +++ b/engine/src/cubos/engine/tools/debug_camera/plugin.cpp @@ -0,0 +1,22 @@ +#include + +#include + +using cubos::core::ecs::Write; + +using namespace cubos::engine; + +static void inspector(Write settings) +{ + ImGui::Begin("Debug Camera"); + + printf("debug camera"); + + ImGui::End(); +} + +void cubos::engine::tools::debugCameraPlugin(Cubos& cubos) +{ + // cubos.addPlugin(imguiPlugin); + cubos.system(inspector).tagged("cubos.imgui"); +}