feat: add support for stretching ImGui output to window and return to selector functionality
This commit is contained in:
@@ -35,6 +35,9 @@ class FrontendSDL {
|
||||
bool loadROM(const std::filesystem::path& path);
|
||||
void run();
|
||||
std::optional<std::filesystem::path> selectGame();
|
||||
#ifdef IMGUI_FRONTEND
|
||||
bool consumeReturnToSelector();
|
||||
#endif
|
||||
u32 getMapping(InputMappings::Scancode scancode) { return keyboardMappings.getMapping(scancode); }
|
||||
|
||||
SDL_Window* window = nullptr;
|
||||
@@ -60,6 +63,7 @@ class FrontendSDL {
|
||||
bool keyboardAnalogX = false;
|
||||
bool keyboardAnalogY = false;
|
||||
bool emuPaused = false;
|
||||
bool returnToSelector = false;
|
||||
|
||||
private:
|
||||
void setupControllerSensors(SDL_GameController* controller);
|
||||
|
||||
@@ -26,6 +26,7 @@ class ImGuiLayer {
|
||||
void setPaused(bool paused) { isPaused = paused; }
|
||||
void setPauseCallback(std::function<void(bool)> callback) { onPauseChange = std::move(callback); }
|
||||
void setVsyncCallback(std::function<void(bool)> callback) { onVsyncChange = std::move(callback); }
|
||||
void setExitToSelectorCallback(std::function<void()> callback) { onExitToSelector = std::move(callback); }
|
||||
|
||||
private:
|
||||
void drawDebugPanel();
|
||||
@@ -45,6 +46,7 @@ class ImGuiLayer {
|
||||
|
||||
std::function<void(bool)> onPauseChange;
|
||||
std::function<void(bool)> onVsyncChange;
|
||||
std::function<void()> onExitToSelector;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user