Skip to content

Commit

Permalink
added base files
Browse files Browse the repository at this point in the history
  • Loading branch information
roby2014 committed Oct 10, 2023
1 parent 2b3021b commit 78b4a0c
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions engine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
18 changes: 18 additions & 0 deletions engine/include/cubos/engine/tools/debug_camera/plugin.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/// @dir
/// @brief @ref debug-camera-plugin plugin directory.

/// @file
/// @brief Plugin entry point.
/// @ingroup debug-camera-plugin

#pragma once

#include <cubos/engine/cubos.hpp>

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
22 changes: 22 additions & 0 deletions engine/src/cubos/engine/tools/debug_camera/plugin.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include <imgui.h>

#include <cubos/engine/tools/debug_camera/plugin.hpp>

using cubos::core::ecs::Write;

using namespace cubos::engine;

static void inspector(Write<Settings> 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");
}

0 comments on commit 78b4a0c

Please sign in to comment.