mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 09:38:07 +02:00
progs/demos: add fps output to cubemap
This commit is contained in:
parent
153e474d22
commit
75312b6555
1 changed files with 16 additions and 0 deletions
|
|
@ -53,6 +53,8 @@ static GLint FrameParity = 0;
|
|||
static GLenum FilterIndex = 0;
|
||||
static GLint ClampIndex = 0;
|
||||
static GLboolean supportFBO = GL_FALSE;
|
||||
static GLint T0 = 0;
|
||||
static GLint Frames = 0;
|
||||
|
||||
|
||||
static struct {
|
||||
|
|
@ -268,6 +270,20 @@ static void draw( void )
|
|||
glPopMatrix();
|
||||
|
||||
glutSwapBuffers();
|
||||
|
||||
Frames++;
|
||||
|
||||
{
|
||||
GLint t = glutGet(GLUT_ELAPSED_TIME);
|
||||
if (t - T0 >= 5000) {
|
||||
GLfloat seconds = (t - T0) / 1000.0;
|
||||
GLfloat fps = Frames / seconds;
|
||||
printf("%d frames in %6.3f seconds = %6.3f FPS\n", Frames, seconds, fps);
|
||||
fflush(stdout);
|
||||
T0 = t;
|
||||
Frames = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue