mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-11-22 10:42:29 +01:00
Add display fps in debug mode
This commit is contained in:
parent
2b0c959609
commit
6a4cae4e24
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user