mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 22:49:13 +02:00
progs/egl: put declarations before code
This commit is contained in:
parent
6c21c8862b
commit
5b7d9053a0
3 changed files with 15 additions and 10 deletions
|
|
@ -274,10 +274,10 @@ draw(void)
|
|||
static void
|
||||
reshape(int width, int height)
|
||||
{
|
||||
glViewport(0, 0, (GLint) width, (GLint) height);
|
||||
|
||||
GLfloat h = (GLfloat) height / (GLfloat) width;
|
||||
|
||||
glViewport(0, 0, (GLint) width, (GLint) height);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glFrustum(-1.0, 1.0, -h, h, 5.0, 60.0);
|
||||
|
|
@ -333,6 +333,8 @@ static void run_gears(EGLDisplay dpy, EGLSurface surf, int ttr)
|
|||
double st = current_time();
|
||||
double ct = st;
|
||||
int frames = 0;
|
||||
GLfloat seconds, fps;
|
||||
|
||||
while (ct - st < ttr)
|
||||
{
|
||||
double tt = current_time();
|
||||
|
|
@ -352,8 +354,8 @@ static void run_gears(EGLDisplay dpy, EGLSurface surf, int ttr)
|
|||
frames++;
|
||||
}
|
||||
|
||||
GLfloat seconds = ct - st;
|
||||
GLfloat fps = frames / seconds;
|
||||
seconds = ct - st;
|
||||
fps = frames / seconds;
|
||||
printf("%d frames in %3.1f seconds = %6.3f FPS\n", frames, seconds, fps);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -127,6 +127,7 @@ static void run(EGLDisplay dpy, EGLSurface surf, int ttr)
|
|||
double st = current_time();
|
||||
double ct = st;
|
||||
int frames = 0;
|
||||
GLfloat seconds, fps;
|
||||
|
||||
while (ct - st < ttr)
|
||||
{
|
||||
|
|
@ -139,8 +140,8 @@ static void run(EGLDisplay dpy, EGLSurface surf, int ttr)
|
|||
frames++;
|
||||
}
|
||||
|
||||
GLfloat seconds = ct - st;
|
||||
GLfloat fps = frames / seconds;
|
||||
seconds = ct - st;
|
||||
fps = frames / seconds;
|
||||
printf("%d frames in %3.1f seconds = %6.3f FPS\n", frames, seconds, fps);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -274,10 +274,10 @@ draw(void)
|
|||
static void
|
||||
reshape(int width, int height)
|
||||
{
|
||||
glViewport(0, 0, (GLint) width, (GLint) height);
|
||||
|
||||
GLfloat h = (GLfloat) height / (GLfloat) width;
|
||||
|
||||
glViewport(0, 0, (GLint) width, (GLint) height);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glFrustum(-1.0, 1.0, -h, h, 5.0, 60.0);
|
||||
|
|
@ -333,6 +333,8 @@ static void run_gears(EGLDisplay dpy, EGLSurface surf, int ttr)
|
|||
double st = current_time();
|
||||
double ct = st;
|
||||
int frames = 0;
|
||||
GLfloat seconds, fps;
|
||||
|
||||
while (ct - st < ttr)
|
||||
{
|
||||
double tt = current_time();
|
||||
|
|
@ -352,8 +354,8 @@ static void run_gears(EGLDisplay dpy, EGLSurface surf, int ttr)
|
|||
frames++;
|
||||
}
|
||||
|
||||
GLfloat seconds = ct - st;
|
||||
GLfloat fps = frames / seconds;
|
||||
seconds = ct - st;
|
||||
fps = frames / seconds;
|
||||
printf("%d frames in %3.1f seconds = %6.3f FPS\n", frames, seconds, fps);
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue