summaryrefslogtreecommitdiff
path: root/progs/demos/cubemap.c
diff options
context:
space:
mode:
Diffstat (limited to 'progs/demos/cubemap.c')
-rw-r--r--progs/demos/cubemap.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/progs/demos/cubemap.c b/progs/demos/cubemap.c
index 0df5ff09c3..20332b1d96 100644
--- a/progs/demos/cubemap.c
+++ b/progs/demos/cubemap.c
@@ -58,6 +58,9 @@ static GLint ClampIndex = 0;
static GLboolean supportFBO = GL_FALSE;
static GLboolean supportSeamless = GL_FALSE;
static GLboolean seamless = GL_FALSE;
+static GLuint TexObj = 0;
+static GLint T0 = 0;
+static GLint Frames = 0;
static struct {
@@ -282,6 +285,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;
+ }
+ }
}
@@ -543,6 +560,10 @@ static void init( GLboolean useImageFiles )
printf("GL_RENDERER: %s\n", (char *) glGetString(GL_RENDERER));
+
+ glGenTextures(1, &TexObj);
+ glBindTexture(GL_TEXTURE_CUBE_MAP_ARB, TexObj);
+
if (useImageFiles) {
load_envmaps();
}