Integrate standalone FSUI into Panda SDL frontend

This commit is contained in:
moonpower
2026-04-03 06:16:04 +02:00
parent 6be36b20ed
commit f2bc79352f
14 changed files with 2348 additions and 471 deletions

View File

@@ -4,10 +4,17 @@
#include <SDL.h>
#include <filesystem>
#include <functional>
#include <memory>
#include <optional>
#include "emulator.hpp"
#include "fsui/backend_sdl.hpp"
#include "fsui/fsui.hpp"
#include "panda_sdl/panda_fsui.hpp"
struct ImFont;
class ImGuiLayer {
public:
@@ -30,13 +37,24 @@ class ImGuiLayer {
void showPauseMenuFromController();
private:
bool useFullscreenUI();
void drawDebugPanel();
void drawPausePanel();
void drawSettingsPanel();
void drawClassicPausePanel();
void drawClassicSettingsPanel();
void drawSettingsGeneralSection(bool& reloadSettings);
void drawSettingsWindowSection(bool& reloadSettings);
void drawSettingsUISection(bool& reloadSettings);
void drawSettingsGraphicsSection(bool& reloadSettings);
void drawSettingsAudioSection(bool& reloadSettings);
void drawSettingsBatterySection(bool& reloadSettings);
void drawSettingsSDSection(bool& reloadSettings);
SDL_Window* window = nullptr;
SDL_GLContext glContext = nullptr;
Emulator& emu;
fsui::FontStack fontStack;
fsui::SdlImGuiBackend imguiBackend;
PandaFsuiAdapter fsuiAdapter;
bool showDebug = true;
bool showPauseMenu = false;
@@ -44,6 +62,7 @@ class ImGuiLayer {
bool isPaused = false;
bool captureKeyboard = false;
bool captureMouse = false;
bool fullscreenSelectorMode = false;
std::function<void(bool)> onPauseChange;
std::function<void(bool)> onVsyncChange;