diff options
author | Chia-I Wu <[email protected]> | 2010-01-12 11:25:02 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2010-01-12 11:25:02 +0800 |
commit | 562c127693200822f04a145db50add1be2425d7b (patch) | |
tree | 9441774fb212b17ddf2a364f06abc43f166cc00b /progs/vp | |
parent | e5d351dcfde58777162552cf5cd2a9cd8299f4cd (diff) | |
parent | 077d6dd7508af88509dd0499c5dfbdaa186b4015 (diff) |
Merge branch 'master' into opengl-es-v2
Conflicts:
src/mesa/main/dd.h
Diffstat (limited to 'progs/vp')
-rw-r--r-- | progs/vp/SConscript | 11 | ||||
-rw-r--r-- | progs/vp/add-param-imm.txt | 7 | ||||
-rw-r--r-- | progs/vp/vp-tris.c | 5 |
3 files changed, 13 insertions, 10 deletions
diff --git a/progs/vp/SConscript b/progs/vp/SConscript index 640c5dd8470..787cb793af2 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 00000000000..90bcf96528f --- /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 1356242d971..09236c296f7 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) { |