PixelBullet  0.0.1
A C++ game engine
Loading...
Searching...
No Matches
imgui_layer_internal.h
1#pragma once
2
3#include "pixelbullet/core/event.h"
4
5#include "pixelbullet/application/imgui/imgui_layer.h"
6#include "pixelbullet/application/imgui/imgui_layer_runtime_backend_internal.h"
7#include "pixelbullet/application/imgui/imgui_platform_backend_internal.h"
8
9#include <array>
10#include <memory>
11#include <string>
12
13namespace pixelbullet
14{
15class Graphics;
16class RenderDevice;
17class Window;
18} // namespace pixelbullet
19
20namespace pixelbullet
21{
23{
24 Impl(Window& window_in, Graphics& graphics_in);
25 Impl(Window& window_in, Graphics& graphics_in, std::filesystem::path settings_path_in);
26 ~Impl();
27
28 void OnAttach();
29 void OnDetach();
30 pixelbullet::core::EventResult OnEvent(pixelbullet::core::Event& event);
31
32 bool BeginUiFrame();
33 void CancelUiFrame();
34 bool Begin();
35 void CancelFrame();
36 void End(const RenderFrameContext& frame_context);
37
38 ImTextureID GetTexture(const std::shared_ptr<void>& texture);
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 void RestoreMainViewportPlatformHandles();
54 RenderDevice& GetRenderDevice() const;
55
56 bool block_events = true;
57 Window& window;
58 Graphics& graphics;
59 bool frame_started = false;
60 bool appearance_dirty = false;
61 std::unique_ptr<pixelbullet::application_internal::ImGuiLayerRuntimeBackend> runtime;
62 std::unique_ptr<pixelbullet::application_internal::ImGuiPlatformBackend> platform_backend;
63 ImGuiAppearanceConfig appearance_config{};
64 ImFont* default_font = nullptr;
65 ImFont* mono_font = nullptr;
66 std::array<ImWchar, 3> icon_font_ranges{};
67 std::array<ImWchar, 3> icon_font_exclude_ranges{};
68 std::filesystem::path settings_path;
69 std::string settings_filename;
70};
71} // namespace pixelbullet
Host-facing graphics subsystem shell.
Definition graphics.h:21
Definition render_device.h:15
Definition render_frame_context.h:15
Definition window.h:30
Definition event.h:108
Definition imgui_layer.h:30
Definition imgui_layer_internal.h:23