mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-14 08:12:16 +00:00
FPS counter now appears at the top left corner every time (#1426)
This commit is contained in:
parent
be1d11eb62
commit
406041b7ad
1 changed files with 7 additions and 2 deletions
|
@ -19,6 +19,7 @@ using namespace Core::Devtools;
|
||||||
using L = Core::Devtools::Layer;
|
using L = Core::Devtools::Layer;
|
||||||
|
|
||||||
static bool show_simple_fps = false;
|
static bool show_simple_fps = false;
|
||||||
|
static bool visibility_toggled = false;
|
||||||
|
|
||||||
static float fps_scale = 1.0f;
|
static float fps_scale = 1.0f;
|
||||||
static bool show_advanced_debug = false;
|
static bool show_advanced_debug = false;
|
||||||
|
@ -296,20 +297,24 @@ void L::Draw() {
|
||||||
const auto fn = DebugState.flip_frame_count.load();
|
const auto fn = DebugState.flip_frame_count.load();
|
||||||
frame_graph.AddFrame(fn, io.DeltaTime);
|
frame_graph.AddFrame(fn, io.DeltaTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsKeyPressed(ImGuiKey_F10, false)) {
|
if (IsKeyPressed(ImGuiKey_F10, false)) {
|
||||||
if (io.KeyCtrl) {
|
if (io.KeyCtrl) {
|
||||||
show_advanced_debug = !show_advanced_debug;
|
show_advanced_debug = !show_advanced_debug;
|
||||||
} else {
|
} else {
|
||||||
show_simple_fps = !show_simple_fps;
|
show_simple_fps = !show_simple_fps;
|
||||||
}
|
}
|
||||||
|
visibility_toggled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (show_simple_fps) {
|
if (show_simple_fps) {
|
||||||
if (Begin("Video Info", nullptr,
|
if (Begin("Video Info", nullptr,
|
||||||
ImGuiWindowFlags_NoNav | ImGuiWindowFlags_NoDecoration |
|
ImGuiWindowFlags_NoNav | ImGuiWindowFlags_NoDecoration |
|
||||||
ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoDocking)) {
|
ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoDocking)) {
|
||||||
SetWindowPos("Video Info", {999999.0f, 0.0f}, ImGuiCond_FirstUseEver);
|
// Set window position to top left if it was toggled on
|
||||||
|
if (visibility_toggled) {
|
||||||
|
SetWindowPos("Video Info", {999999.0f, 0.0f}, ImGuiCond_Always);
|
||||||
|
visibility_toggled = false;
|
||||||
|
}
|
||||||
if (BeginPopupContextWindow()) {
|
if (BeginPopupContextWindow()) {
|
||||||
#define M(label, value) \
|
#define M(label, value) \
|
||||||
if (MenuItem(label, nullptr, fps_scale == value)) \
|
if (MenuItem(label, nullptr, fps_scale == value)) \
|
||||||
|
|
Loading…
Add table
Reference in a new issue