Skip to content

Commit

Permalink
[WIP] Work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
IAmNotHanni committed Jul 23, 2024
1 parent c9cc646 commit 2611084
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 2 additions & 0 deletions include/inexor/vulkan-renderer/renderers/imgui.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ class ImGuiRenderer {
std::vector<std::uint32_t> m_index_data;
std::vector<ImDrawVert> m_vertex_data;

ImGuiContext *m_imgui_context{nullptr};

unsigned char *m_font_texture_data{nullptr};
int m_font_texture_width{0};
int m_font_texture_height{0};
Expand Down
5 changes: 0 additions & 5 deletions src/vulkan-renderer/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,6 @@ void Application::mouse_button_callback(GLFWwindow * /*window*/, int button, int
if (button < 0 || button > GLFW_MOUSE_BUTTON_LAST) {
return;
}

switch (action) {
case GLFW_PRESS:
m_input_data->press_mouse_button(button);
Expand Down Expand Up @@ -375,11 +374,7 @@ void Application::recreate_swapchain() {
glfwGetFramebufferSize(m_window->get(), &wnd_width, &wnd_height);

m_swapchain->setup(wnd_width, wnd_height, m_vsync_enabled);

// TODO: Unified API style like this: m_device->create_rendergraph(m_swapchain);
// TODO: Maybe make RenderGraph constructor (and others) private and only allow device wrapper to call it?
m_render_graph = std::make_unique<render_graph::RenderGraph>(*m_device);

setup_render_graph();
}

Expand Down
6 changes: 4 additions & 2 deletions src/vulkan-renderer/renderers/imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ ImGuiRenderer::ImGuiRenderer(const Device &device,
// NOTE: It's valid for previous_pass to be an invalid pointer (in that case there is no previous pass!)

spdlog::trace("Creating ImGui context");
ImGui::CreateContext();
m_imgui_context = ImGui::CreateContext();
ImGui::SetCurrentContext(m_imgui_context);

spdlog::trace("Loading ImGui font texture");
load_font_data_from_file();
Expand Down Expand Up @@ -192,7 +193,8 @@ ImGuiRenderer::ImGuiRenderer(ImGuiRenderer &&other) noexcept {
}

ImGuiRenderer::~ImGuiRenderer() {
ImGui::DestroyContext();
ImGui::DestroyContext(m_imgui_context);
m_imgui_context = nullptr;
}

void ImGuiRenderer::load_font_data_from_file() {
Expand Down

0 comments on commit 2611084

Please sign in to comment.