1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-09-15 06:52:34 +02:00

Add display fps in debug mode

This commit is contained in:
Elias Steurer 2023-03-02 13:22:57 +01:00
parent 2b0c959609
commit 6a4cae4e24

View File

@ -282,13 +282,24 @@ Rectangle {
]
}
FrameAnimation {
id: frameAnimation
property real fps: smoothFrameTime > 0 ? (1.0 / smoothFrameTime) : 0
readonly property string ft: (1000 * smoothFrameTime).toFixed(1)
readonly property real maxFPS: 24.0
readonly property real maxPeriod: 1.0 / maxFPS
readonly property int skipFrames: fps / maxFPS
running: Wallpaper.debugMode
}
Pane {
id: debug
visible: Wallpaper.debugMode
enabled: Wallpaper.debugMode
width: parent.width * 0.3
height: parent.height * 0.3
width: parent.width * 0.6
height: parent.height * 0.5
anchors.centerIn: parent
Column {
@ -296,6 +307,14 @@ Rectangle {
anchors.margins: 20
spacing: 10
Text {
visible: Wallpaper.debugMode
enabled: Wallpaper.debugMode
font.pointSize: 14
text: "fps: " + frameAnimation.fps.toFixed(0) + " - Frame time:"+ frameAnimation.ft + " ms"
}
Text {
text: "appID " + Wallpaper.appID
font.pointSize: 14