frontend separation

This commit is contained in:
CocoSimone
2022-07-11 11:59:11 +02:00
parent ac0f3ffd8c
commit a54f2cbfb7
41 changed files with 5419 additions and 409 deletions

View File

@@ -0,0 +1,42 @@
#pragma once
#include <imgui.h>
#include <imgui_impl_sdl.h>
#include <imgui_impl_vulkan.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_vulkan.h>
#include <vulkan/vulkan.h>
#include <BaseCore.hpp>
#include <vector>
struct Window {
Window();
~Window();
void Update(std::unique_ptr<BaseCore>&);
[[nodiscard]] bool gotClosed(SDL_Event event) {
return event.type == SDL_WINDOWEVENT
&& event.window.event == SDL_WINDOWEVENT_CLOSE
&& event.window.windowID == SDL_GetWindowID(window);
}
private:
void InitSDL();
void InitVulkan(const std::vector<const char*>&, u32);
void InitVulkanWindow();
void InitImgui();
void Render(ImDrawData*);
void Present();
SDL_Window* window{};
VkInstance instance{};
VkPhysicalDevice physicalDevice{};
VkDevice device{};
uint32_t queueFamily{uint32_t(-1)};
VkQueue queue{};
VkPipelineCache pipelineCache{};
VkDescriptorPool descriptorPool{};
ImGui_ImplVulkanH_Window windowData;
u32 minImageCount = 2;
bool rebuildSwapchain = false;
};