Fix imgui support + update README.md
This commit is contained in:
@@ -9,7 +9,7 @@ void App::Run() {
|
||||
while (!done) {
|
||||
SDL_Event event;
|
||||
while (SDL_PollEvent(&event)) {
|
||||
//ImGui_ImplSDL2_ProcessEvent(&event);
|
||||
ImGui_ImplSDL2_ProcessEvent(&event);
|
||||
switch(event.type) {
|
||||
case SDL_QUIT: done = true; break;
|
||||
case SDL_WINDOWEVENT:
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ private:
|
||||
void InitImgui();
|
||||
void Render(n64::Core& core);
|
||||
|
||||
VkInstance instance{};
|
||||
VkPhysicalDevice physicalDevice{};
|
||||
VkDevice device{};
|
||||
uint32_t queueFamily{uint32_t(-1)};
|
||||
|
||||
Reference in New Issue
Block a user