SDEngine
Game Engine
Loading...
Searching...
No Matches
SDImGuiContext.hpp
Go to the documentation of this file.
1// TODO(docs): Add file-level Doxygen header
2// - @file SDImGuiContext.hpp
3// - @brief ImGui context and Vulkan backend setup
4// - Dock space management
5// - Texture descriptor set utilities
6#pragma once
7#include <imgui.h>
8
9#include <backends/imgui_impl_vulkan.h>
10
11#include "SD/core/Window.hpp"
14
15namespace sd {
16
18 std::function<void()> close_app;
19};
20// TODO(docs): Document SDImGuiContext class
21// - Purpose: Manages ImGui context and Vulkan integration
22// - Init/Shutdown lifecycle
23// - Frame begin/end pattern
24// - Dock space creation (BeginDockSpace/EndDockSpace)
25// - Texture utilities (CreateTextureFromView, RemoveTexture)
26// - Example: Setting up ImGui in a custom layer
31 SDImGuiContext(SDImGuiContext&& other) noexcept = delete;
34
35
37
38 void shutdown();
39
40 void begin_frame();
41 void end_frame();
42 void render_draw_data(vk::CommandBuffer cmd);
44
45 void begin_dock_space(const std::string& title = "SDEngine Editor");
46 void end_dock_space();
47
48 ImGuiContext* get_context() const { return m_context; }
49 vk::DescriptorPool get_descriptor_pool() const { return *m_descriptor_pool; }
50
55
56
58
59
61
63
64 vk::UniqueDescriptorPool m_descriptor_pool;
65 vk::UniqueSampler m_default_sampler;
67};
68
69} // namespace sd
Definition Application.hpp:22
Definition SDImGuiContext.hpp:17
std::function< void()> close_app
Definition SDImGuiContext.hpp:18
Definition SDImGuiContext.hpp:27
SDImGuiContext(SDImGuiContext &&other) noexcept=delete
void update_platform_windows()
Definition SDImGuiContext.cpp:113
VkDescriptorSet create_texture_from_view(VkImageView view, VkImageLayout layout=VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL)
Definition SDImGuiContext.cpp:218
void init(Window &window, VulkanWindow &vw)
Definition SDImGuiContext.cpp:13
SDImGuiContext(const SDImGuiCallbacks &callbacks)
Definition SDImGuiContext.hpp:28
ImGuiContext * m_context
Definition SDImGuiContext.hpp:60
vk::UniqueSampler m_default_sampler
Definition SDImGuiContext.hpp:65
void end_dock_space()
Definition SDImGuiContext.cpp:186
void shutdown()
Definition SDImGuiContext.cpp:82
void end_frame()
Definition SDImGuiContext.cpp:105
~SDImGuiContext()
Definition SDImGuiContext.cpp:9
bool m_is_vulkan_initialized
Definition SDImGuiContext.hpp:66
ImGuiContext * get_context() const
Definition SDImGuiContext.hpp:48
SDImGuiContext(const SDImGuiContext &other)=delete
void begin_dock_space(const std::string &title="SDEngine Editor")
Definition SDImGuiContext.cpp:121
vk::DescriptorPool get_descriptor_pool() const
Definition SDImGuiContext.hpp:49
void render_draw_data(vk::CommandBuffer cmd)
Definition SDImGuiContext.cpp:109
void remove_texture(VkDescriptorSet descriptor_set)
Definition SDImGuiContext.cpp:222
vk::UniqueDescriptorPool m_descriptor_pool
Definition SDImGuiContext.hpp:64
SDImGuiContext & operator=(const SDImGuiContext &other)=delete
void begin_frame()
Definition SDImGuiContext.cpp:98
void create_descriptor_pool(VulkanContext &ctx)
Definition SDImGuiContext.cpp:190
SDImGuiCallbacks m_callbacks
Definition SDImGuiContext.hpp:62
SDImGuiContext & operator=(SDImGuiContext &&other) noexcept=delete
Definition VulkanContext.hpp:22
Definition VulkanWindow.hpp:35
Definition Window.hpp:49
consteval U64 type_id_of()
Definition type_id.hpp:6