It renders something, crashes because ImGui exhausts the display list. Need to find a better way for thread sync. Message queue?

This commit is contained in:
irisz64
2025-05-22 09:16:58 +02:00
parent 668edbcd91
commit 326b4b43cd
7 changed files with 25 additions and 43 deletions

View File

@@ -4,8 +4,8 @@
#include <ImGuiImpl/StatusBar.hpp>
#include <ImGuiImpl/GUI.hpp>
KaizenGui::KaizenGui() noexcept : window("Kaizen", 1280, 720), core(std::make_shared<n64::Core>()), vulkanWidget(core, window.getHandle()), emuThread(core, fpsCounter, vulkanWidget, settingsWindow, *this) {
core->parallel.Init(vulkanWidget.wsiPlatform, vulkanWidget.windowInfo, core->cpu->GetMem().GetRDRAMPtr());
KaizenGui::KaizenGui() noexcept : window("Kaizen", 1280, 720), core(std::make_shared<n64::Core>()), vulkanWidget(core, window.getHandle()), emuThread(core, fpsCounter, vulkanWidget, settingsWindow) {
while(!emuThread.parallelRDPInitialized);
gui::Initialize(core->parallel.wsi, window.getHandle());
emuExitFunc = [&]() {
@@ -27,7 +27,8 @@ KaizenGui::KaizenGui() noexcept : window("Kaizen", 1280, 720), core(std::make_sh
});
statusBar.setFunc([&]() {
ImGui::Text("GUI FPS: %.2f, Emulation FPS: %.2f", ImGui::GetIO().Framerate, fpsCounter);
ImGui::Text("GUI FPS: %.2f, Emulation FPS: %s", ImGui::GetIO().Framerate,
fmt::format(fpsCounter > 0 ? fmt::runtime("{:.2f{0}}") : fmt::runtime("{1}"), fpsCounter, "Not playing").c_str());
});
menuBar.addMenu({"File",
@@ -102,6 +103,8 @@ void KaizenGui::handleEvents() {
int KaizenGui::run() {
while(!quit) {
handleEvents();
RenderUI();
}
return 0;