VEX Engine
Retro looking game engine made in vulkan mostly because i wanted to understand it better.
Loading...
Searching...
No Matches
VulkanImGUIWrapper.hpp
Go to the documentation of this file.
1
6
7#pragma once
8
10#include "components/ErrorUtils.hpp"
11#include "context.hpp"
12
13#include <SDL3/SDL.h>
14#include <SDL3/SDL_vulkan.h>
15
16#if DEBUG
17#include <imgui.h>
18#include <backends/imgui_impl_sdl3.h>
19#include <backends/imgui_impl_vulkan.h>
20#endif
21
22namespace vex {
25 public:
29 VulkanImGUIWrapper(SDL_Window* window, VulkanContext& vulkanContext);
30
32 virtual ~VulkanImGUIWrapper();
33
39 VkDescriptorSet addTexture(VkSampler sampler, VkImageView imageView, VkImageLayout layout);
40
43 void removeTexture(VkDescriptorSet descriptorSet);
44
45#if DEBUG
47 void init() override;
49 void beginFrame() override;
51 void endFrame() override;
53 void processEvent(const SDL_Event* event) override;
56 ImGuiIO& getIO() override;
57 void draw(VkCommandBuffer commandBuffer);
58#else
59 void init() override { return; }
60 void beginFrame() override { return; }
61 void endFrame() override { return; }
62 void processEvent(const SDL_Event* event) override { return; }
63 void draw(VkCommandBuffer commandBuffer) { return; }
64#endif
65
66
67 private:
68#if DEBUG
70 void createDescriptorPool();
72 void setupStyle();
73
74 VkDescriptorPool m_imguiPool = VK_NULL_HANDLE;
75 bool m_initialized = false;
76#endif
77 SDL_Window *m_p_window;
78 VulkanContext& m_r_context;
79 };
80}
This file defines ImGUIWrapper class.
This class provides an interface template for ImGui Implementation. Every backend should implement th...
virtual ~VulkanImGUIWrapper()
Destructor for VulkanImGUIWrapper.
void init() override
Initialization called inside Engine class.
VulkanImGUIWrapper(SDL_Window *window, VulkanContext &vulkanContext)
Constructor for VulkanImGUIWrapper.
void processEvent(const SDL_Event *event) override
Its used to process input needed by interaction with ImGui.
void beginFrame() override
Begining of UI rendering called in vex::Renderer::renderFrame.
void removeTexture(VkDescriptorSet descriptorSet)
Removes a texture from the ImGUI wrapper.
void endFrame() override
Ends UI rendering for frame.
VkDescriptorSet addTexture(VkSampler sampler, VkImageView imageView, VkImageLayout layout)
Adds a texture to the ImGUI wrapper.
This file defines struct holding all vulkan data, like device, surface, swapchain,...
Struct holding all vulkan data, like device, surface, swapchain, images, views, and more.
Definition context.hpp:26