mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2025-02-16 19:05:39 +00:00
SDL: Re-add frame step hotkey
Needs porting to Qt at some point.
This commit is contained in:
parent
1c50a09c2e
commit
93031fc27f
|
@ -351,6 +351,8 @@ bool SDLHostInterface::Initialize()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RegisterHotkeys();
|
||||||
|
|
||||||
ImGui::NewFrame();
|
ImGui::NewFrame();
|
||||||
|
|
||||||
// process events to pick up controllers before updating input map
|
// process events to pick up controllers before updating input map
|
||||||
|
@ -1334,6 +1336,16 @@ void SDLHostInterface::ClearImGuiFocus()
|
||||||
ImGui::SetWindowFocus(nullptr);
|
ImGui::SetWindowFocus(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SDLHostInterface::RegisterHotkeys()
|
||||||
|
{
|
||||||
|
RegisterHotkey(StaticString("General"), StaticString("FrameStep"), StaticString("Frame Step"), [this](bool pressed) {
|
||||||
|
if (!pressed)
|
||||||
|
{
|
||||||
|
DoFrameStep();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
void SDLHostInterface::DoStartDisc()
|
void SDLHostInterface::DoStartDisc()
|
||||||
{
|
{
|
||||||
Assert(!m_system);
|
Assert(!m_system);
|
||||||
|
|
|
@ -72,6 +72,7 @@ private:
|
||||||
void DestroyDisplay();
|
void DestroyDisplay();
|
||||||
void CreateImGuiContext();
|
void CreateImGuiContext();
|
||||||
void UpdateFramebufferScale();
|
void UpdateFramebufferScale();
|
||||||
|
void RegisterHotkeys();
|
||||||
|
|
||||||
/// Executes a callback later, after the UI has finished rendering. Needed to boot while rendering ImGui.
|
/// Executes a callback later, after the UI has finished rendering. Needed to boot while rendering ImGui.
|
||||||
void RunLater(std::function<void()> callback);
|
void RunLater(std::function<void()> callback);
|
||||||
|
|
Loading…
Reference in a new issue