shadPS4/src/imgui/layer/video_info.cpp
Vinicius Rangel 035cb3eeaa
Dear ImGui Implementation (#598)
* added imgui as dependency

* imgui renderer/basic input implementation

* imgui: add layers system

Add video info layer to show fps. Press F10 to toggle it.

* imgui: add custom imgui config

* imgui: gamepad capture, stopping propagation

* imgui: changed config & log file path to use portable dir

* videoout: render blank frame when video output is closed

required to render imgui even when game has no video output

- fixed merge compile-error
2024-09-08 22:50:32 +03:00

17 lines
439 B
C++

// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include <imgui.h>
#include "video_info.h"
void ImGui::Layers::VideoInfo::Draw() {
const ImGuiIO& io = GetIO();
m_show = IsKeyPressed(ImGuiKey_F10, false) ^ m_show;
if (m_show && Begin("Video Info")) {
Text("Frame time: %.3f ms (%.1f FPS)", 1000.0f / io.Framerate, io.Framerate);
End();
}
}