summaryrefslogtreecommitdiff
path: root/progs/vp
diff options
context:
space:
mode:
Diffstat (limited to 'progs/vp')
-rw-r--r--progs/vp/SConscript11
-rw-r--r--progs/vp/add-param-imm.txt7
-rw-r--r--progs/vp/vp-tris.c5
3 files changed, 13 insertions, 10 deletions
diff --git a/progs/vp/SConscript b/progs/vp/SConscript
index 640c5dd847..787cb793af 100644
--- a/progs/vp/SConscript
+++ b/progs/vp/SConscript
@@ -1,13 +1,6 @@
-Import('env')
+Import('*')
-if not env['GLUT']:
- Return()
-
-env = env.Clone()
-
-env.Prepend(LIBS = ['$GLUT_LIB'])
-
-env.Program(
+progs_env.Program(
target = 'vp-tris',
source = ['vp-tris.c'],
)
diff --git a/progs/vp/add-param-imm.txt b/progs/vp/add-param-imm.txt
new file mode 100644
index 0000000000..90bcf96528
--- /dev/null
+++ b/progs/vp/add-param-imm.txt
@@ -0,0 +1,7 @@
+!!ARBvp1.0
+TEMP R0;
+PARAM Emission = state.material.emission;
+ADD R0, vertex.color, {-0.5}.x;
+ADD result.color, R0, Emission.w;
+MOV result.position, vertex.position;
+END
diff --git a/progs/vp/vp-tris.c b/progs/vp/vp-tris.c
index 1356242d97..09236c296f 100644
--- a/progs/vp/vp-tris.c
+++ b/progs/vp/vp-tris.c
@@ -96,12 +96,15 @@ static void Init( void )
exit(1);
}
- sz = (GLuint) fread(buf, 1, sizeof(buf), f);
+ sz = (GLuint) fread(buf, 1, sizeof(buf) - 1, f);
+ buf[sizeof(buf) - 1] = '\0';
if (!feof(f)) {
fprintf(stderr, "file too long\n");
+ fclose(f);
exit(1);
}
+ fclose(f);
fprintf(stderr, "%.*s\n", sz, buf);
if (strncmp( buf, "!!VP", 4 ) == 0) {