Fix imgui support + update README.md

This commit is contained in:
CocoSimone
2022-08-19 23:42:15 +02:00
parent 02636d38b6
commit 7962ae12e3
31 changed files with 53895 additions and 29 deletions

View File

@@ -4,10 +4,12 @@
#include <Core.hpp>
#include <utility>
VkInstance instance{};
Window::Window(n64::Core& core) {
InitSDL();
InitParallelRDP(core.mem.GetRDRAM(), window);
//InitImgui();
InitImgui();
NFD::Init();
}
@@ -61,6 +63,8 @@ void Window::InitImgui() {
allocator = nullptr;
minImageCount = 2;
ImGui_ImplVulkan_LoadFunctions([](const char* function_name, void*) { return vkGetInstanceProcAddr(instance, function_name); });
{
VkDescriptorPoolSize poolSizes[] = {
{ VK_DESCRIPTOR_TYPE_SAMPLER, 1000 },
@@ -168,9 +172,9 @@ void Window::InitImgui() {
Window::~Window() {
VkResult err = vkDeviceWaitIdle(device);
check_vk_result(err);
//ImGui_ImplVulkan_Shutdown();
//ImGui_ImplSDL2_Shutdown();
//ImGui::DestroyContext();
ImGui_ImplVulkan_Shutdown();
ImGui_ImplSDL2_Shutdown();
ImGui::DestroyContext();
vkDestroyDescriptorPool(device, descriptorPool, nullptr);
vkDestroyDevice(device, nullptr);
vkDestroyInstance(instance, nullptr);
@@ -180,13 +184,13 @@ Window::~Window() {
}
ImDrawData* Window::Present(n64::Core& core) {
//ImGui_ImplVulkan_NewFrame();
//ImGui_ImplSDL2_NewFrame(window);
//ImGui::NewFrame();
ImGui_ImplVulkan_NewFrame();
ImGui_ImplSDL2_NewFrame(window);
ImGui::NewFrame();
//
Render(core);
//ImGui::Render();
ImGui::Render();
return ImGui::GetDrawData();
}