@@ -6,6 +6,7 @@ import androidx.compose.foundation.background
66import androidx.compose.foundation.layout.*
77import androidx.compose.material.Button
88import androidx.compose.material.MaterialTheme
9+ import androidx.compose.material.Surface
910import androidx.compose.material.Text
1011import androidx.compose.runtime.*
1112import androidx.compose.ui.Alignment
@@ -62,7 +63,6 @@ fun ApplicationScope.App() {
6263 glClearColor(color.red, color.green, color.blue, color.alpha)
6364 glClear(GL_COLOR_BUFFER_BIT )
6465 glBegin(GL_QUADS )
65- // fat rectangle from top left to bottom right
6666 glColor3f(1f , 0f , 0f )
6767 glVertex2f(- 1f , 0f )
6868 glColor3f(0f , 1f , 0f )
@@ -76,20 +76,22 @@ fun ApplicationScope.App() {
7676 val wait = (1000.0 / 60 ).milliseconds
7777 redrawAfter(null )
7878 }
79- Column (modifier = Modifier .align(Alignment .TopStart ).padding(4 .dp)) {
80- val display by state.displayStatistics.collectAsState()
81- Text (" Display datapoints: ${display.frameTimes.values.size} " )
82- Text (" Display frame time: ${display.frameTimes.median.inWholeMicroseconds / 1000.0 } ms" )
83- Text (" Display frame time (99th): ${display.frameTimes.percentile(0.99 ).inWholeMicroseconds / 1000.0 } ms" )
84- Text (" Display FPS: ${display.fps.median} " )
85- Text (" Display FPS (99th): ${display.fps.percentile(0.99 , Stats .Percentile .LOWEST )} " )
79+ Surface (modifier = Modifier .align(Alignment .TopStart ).padding(4 .dp)) {
80+ Column (modifier = Modifier .padding(4 .dp).width(400 .dp)) {
81+ val display by state.displayStatistics.collectAsState()
82+ Text (" Display datapoints: ${display.frameTimes.values.size} " )
83+ Text (" Display frame time: ${display.frameTimes.median.inWholeMicroseconds / 1000.0 } ms" )
84+ Text (" Display frame time (99th): ${display.frameTimes.percentile(0.99 ).inWholeMicroseconds / 1000.0 } ms" )
85+ Text (" Display FPS: ${display.fps.median} " )
86+ Text (" Display FPS (99th): ${display.fps.percentile(0.99 , Stats .Percentile .LOWEST )} " )
8687
87- val render by state.renderStatistics.collectAsState()
88- Text (" Render datapoints: ${render.frameTimes.values.size} " )
89- Text (" Render frame time: ${render.frameTimes.median.inWholeMicroseconds / 1000.0 } ms" )
90- Text (" Render frame time (99th): ${render.frameTimes.percentile(0.99 ).inWholeMicroseconds / 1000.0 } ms" )
91- Text (" Render FPS: ${render.fps.median} ms" )
92- Text (" Render FPS (99th): ${render.fps.percentile(0.99 , Stats .Percentile .LOWEST )} " )
88+ val render by state.renderStatistics.collectAsState()
89+ Text (" Render datapoints: ${render.frameTimes.values.size} " )
90+ Text (" Render frame time: ${render.frameTimes.median.inWholeMicroseconds / 1000.0 } ms" )
91+ Text (" Render frame time (99th): ${render.frameTimes.percentile(0.99 ).inWholeMicroseconds / 1000.0 } ms" )
92+ Text (" Render FPS: ${render.fps.median} ms" )
93+ Text (" Render FPS (99th): ${render.fps.percentile(0.99 , Stats .Percentile .LOWEST )} " )
94+ }
9395 }
9496 Button (
9597 onClick = ::exitApplication,
0 commit comments