PixelBullet  0.0.1
A C++ game engine
Loading...
Searching...
No Matches
imgui_layer_internal.h
1#pragma once
2
3#include "imgui_layer_helpers_internal.h"
4
5#include "pixelbullet/application/layers/imgui_layer.h"
6
7#include <map>
8#include <string>
9#include <vector>
10
11namespace pixelbullet
12{
13class Graphics;
14class Window;
15
17{
19 {
20 std::vector<VkDescriptorSet> descriptor_sets;
21 std::vector<VkImageView> image_views;
22 std::vector<VkSampler> samplers;
23 };
24
25 Impl(Window& window_in, Graphics& graphics_in);
26 Impl(Window& window_in, Graphics& graphics_in, std::filesystem::path settings_path_in);
27
28 void OnAttach();
29 void OnDetach();
30 EventResult OnEvent(Event& event);
31
32 bool BeginUiFrame();
33 void CancelUiFrame();
34 bool Begin();
35 void CancelFrame();
36 void End(VkCommandBuffer command_buffer);
37
38 ImTextureID GetImageTexture(const Image2D& image);
39 ImTextureID GetRenderTargetTexture(std::string_view name);
40 void SetAppearance(const ImGuiAppearanceConfig& appearance);
41 void SetTheme();
42 void SetSettingsPath(std::filesystem::path settings_path_in);
43 void ClearSettings();
44 void LoadSettingsFromDisk(const std::filesystem::path& settings_path_in);
45 void SaveSettings();
46 void SaveSettingsToDisk(const std::filesystem::path& settings_path_in);
47 uint32_t GetActiveWidgetID() const;
48 ImFont* GetMonospaceFont() const noexcept;
49 void BlockEvents(bool block) noexcept;
50
51 void ApplyAppearance(const ImGuiAppearanceConfig& appearance);
52 void ApplySettingsPath();
53 bool EnsureVulkanInitialized();
54 void RestoreMainViewportPlatformHandles();
55 void CreateDescriptorPool(VkDevice device);
56 void DestroySampledImageTextures();
57 void DestroyRenderTargetTextures();
58
59 bool block_events = true;
60 Window& window;
61 Graphics& graphics;
62 VkDescriptorPool descriptor_pool = VK_NULL_HANDLE;
63 VkRenderPass render_pass = VK_NULL_HANDLE;
64 uint32_t image_count = 0;
65 bool vulkan_initialized = false;
66 bool frame_started = false;
67 bool appearance_dirty = false;
68 std::map<application_layers_internal::SampledImageTextureKey, VkDescriptorSet> sampled_image_textures;
69 std::map<std::string, CachedRenderTargetTexture> render_target_textures;
70 ImGuiAppearanceConfig appearance_config{};
71 ImFont* default_font = nullptr;
72 ImFont* mono_font = nullptr;
73 std::filesystem::path settings_path;
74 std::string settings_filename;
75};
76} // namespace pixelbullet
Definition event.h:72
Host-facing graphics subsystem shell.
Definition graphics.h:21
Definition window.h:34
Definition imgui_layer.h:21
Definition imgui_layer_internal.h:17