-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
89 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,25 @@ | ||
/// @file | ||
/// @brief Functions @ref cubos::core::ui::showWorld and @ref cubos::core::ui::editWorld. | ||
/// @ingroup core-ui | ||
|
||
#pragma once | ||
|
||
#include <cubos/core/ecs/world.hpp> | ||
|
||
namespace cubos::core::ui | ||
{ | ||
/// ECS system which allows the user to inspect the entities and components in an ECS world. | ||
/// @brief Adds a ImGui window which allows the user to inspect the entities and components in | ||
/// a @ref ecs::World. | ||
/// @param world World to show. | ||
/// @param context Optional context for serializing the world. | ||
/// @ingroup core-ui | ||
void showWorld(const ecs::World& world, data::Context* context = nullptr); | ||
|
||
/// ECS system which allows the user to inspect and edit the entities and components in an ECS world. | ||
/// @brief Adds a ImGui window which allows the user to edit the entities and components in a | ||
/// @ref ecs::World. | ||
/// @param world World to edit. | ||
/// @param serContext Optional context for serializing the world. | ||
/// @param desContext Optional context for deserializing the world. | ||
/// @ingroup core-ui | ||
void editWorld(ecs::World& world, data::Context* serContext = nullptr, data::Context* desContext = nullptr); | ||
} // namespace cubos::core::ui |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,39 @@ | ||
/// @file | ||
/// @brief Functions for initializing and using ImGui. | ||
/// @ingroup core-ui | ||
|
||
#pragma once | ||
|
||
#include <cubos/core/gl/render_device.hpp> | ||
#include <cubos/core/io/window.hpp> | ||
|
||
namespace cubos::core::ui | ||
{ | ||
/// Initializes ImGui for use with the given window. | ||
/// Should only be called once and no ImGui calls should be made before this is called. | ||
/// @brief Initializes ImGui for use with the given window. | ||
/// @note Should only be called once and no ImGui calls should be made before this is called. | ||
/// @param window The window to use. | ||
/// @ingroup core-ui | ||
void initialize(io::Window window); | ||
|
||
/// Shuts down ImGui. | ||
/// Should only be called once, after @ref initialize, and no ImGui calls should be made after this is called. | ||
/// @brief Shuts down ImGui. | ||
/// @note Should only be called once, after @ref initialize(), and no ImGui calls should be | ||
/// made after this is called. | ||
/// @ingroup core-ui | ||
void terminate(); | ||
|
||
/// Begins a new ImGui frame. | ||
/// @brief Begins a new ImGui frame. | ||
/// @ingroup core-ui | ||
void beginFrame(); | ||
|
||
/// Ends the current ImGui frame, and renders the ImGui draw data to the window. | ||
/// @brief Ends the current ImGui frame, and renders the ImGui draw data to the @p target | ||
/// framebuffer, or the default framebuffer if @p target is null. | ||
/// @param target Framebuffer to render to. | ||
/// @ingroup core-ui | ||
void endFrame(const gl::Framebuffer& target = nullptr); | ||
|
||
/// Passes a window event to ImGui. | ||
/// @param event The event to pass. | ||
/// @return True if the event was consumed by ImGui, false otherwise. | ||
/// @brief Passes a window event to ImGui. | ||
/// @param event Event to pass. | ||
/// @return True if the event was handled by ImGui, false otherwise. | ||
/// @ingroup core-ui | ||
bool handleEvent(const io::WindowEvent& event); | ||
} // namespace cubos::core::ui |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/// @dir | ||
/// @brief @ref core-ui module. | ||
|
||
#pragma once | ||
|
||
/// @namespace cubos::core::ui | ||
/// @brief @ref core-ui module. | ||
/// @ingroup core-ui | ||
|
||
namespace cubos::core::ui | ||
{ | ||
/// @defgroup core-ui User Interface | ||
/// @ingroup core | ||
/// @brief Provides `ImGui` integration and general UI utilities. | ||
} // namespace cubos::core::ui |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters