Skip to content
This repository was archived by the owner on Mar 19, 2025. It is now read-only.

Commit 532a612

Browse files
committed
test.pl FPS box coords data-driven
1 parent 6d50bd5 commit 532a612

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

test.pl

+9-5
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,12 @@
262262
);
263263
my $xform = OpenGL::Array->new_list(GL_FLOAT,@xform);
264264

265+
my @fpsbox_coords = (
266+
0.0, -2.0, 0.0,
267+
0.0, 12.0, 0.0,
268+
140.0, 12.0, 0.0,
269+
140.0, -2.0, 0.0,
270+
);
265271

266272
# ------
267273
# Frames per second (FPS) statistic variables and routine.
@@ -922,12 +928,10 @@ sub cbRenderScene
922928
# Make sure we can read the FPS section by first placing a
923929
# dark, mostly opaque backdrop rectangle.
924930
glColor4f(0.2,0.2,0.2,0.75);
925-
926931
glBegin(GL_QUADS);
927-
glVertex3f( 0.0, -2.0, 0.0);
928-
glVertex3f( 0.0, 12.0, 0.0);
929-
glVertex3f(140.0, 12.0, 0.0);
930-
glVertex3f(140.0, -2.0, 0.0);
932+
for (my $i=0; $i<scalar(@fpsbox_coords); $i+=3) {
933+
glVertex3f(@fpsbox_coords[$i..$i+2]);
934+
}
931935
glEnd();
932936

933937
glColor4f(0.9,0.2,0.2,.75);

0 commit comments

Comments
 (0)