summaryrefslogtreecommitdiffstats
path: root/progs/glsl/vsraytrace.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2010-03-24 09:03:33 -0600
committerBrian Paul <[email protected]>2010-03-24 09:04:17 -0600
commit79394f0267a41cc9ea446c69f4b6530b255019dc (patch)
tree798a4017b85ad5d65bcd53204d476c1cea6ae5df /progs/glsl/vsraytrace.c
parent4e328774d49629fc4bf8960669bdfdab7bb80466 (diff)
progs/glsl: silence warnings, remove debug code, adjust window size, etc
Diffstat (limited to 'progs/glsl/vsraytrace.c')
-rw-r--r--progs/glsl/vsraytrace.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/progs/glsl/vsraytrace.c b/progs/glsl/vsraytrace.c
index 6e1617a7ebd..37b8f774aa7 100644
--- a/progs/glsl/vsraytrace.c
+++ b/progs/glsl/vsraytrace.c
@@ -30,8 +30,7 @@
static int Win;
-//static int WinWidth = 256, WinHeight = 256;
-static int WinWidth = 50, WinHeight = 50;
+static int WinWidth = 256, WinHeight = 256;
static int mouseGrabbed = 0;
static const char* vsSource =
@@ -241,18 +240,21 @@ Draw(void)
glutSwapBuffers();
- static int frames = 0;
- static int t0 = 0;
- static int t1 = 0;
- frames++;
- t1 = glutGet(GLUT_ELAPSED_TIME);
- float dt = (float)(t1-t0)/1000.0F;
- if(dt >= 5.0F)
{
- float fps = (float)frames / dt;
- printf("%f FPS (%d frames in %f seconds)\n", fps, frames, dt);
- frames = 0;
- t0 = t1;
+ static int frames = 0;
+ static int t0 = 0;
+ static int t1 = 0;
+ float dt;
+ frames++;
+ t1 = glutGet(GLUT_ELAPSED_TIME);
+ dt = (float)(t1-t0)/1000.0F;
+ if (dt >= 5.0F)
+ {
+ float fps = (float)frames / dt;
+ printf("%f FPS (%d frames in %f seconds)\n", fps, frames, dt);
+ frames = 0;
+ t0 = t1;
+ }
}
}
@@ -344,9 +346,8 @@ Init(void)
int
main(int argc, char *argv[])
{
-// setenv("LIBGL_ALWAYS_SOFTWARE", "1", 1);
- glutInit(&argc, argv);
glutInitWindowSize(WinWidth, WinHeight);
+ glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
Win = glutCreateWindow(argv[0]);
glewInit();