summaryrefslogtreecommitdiff
path: root/progs/fp
diff options
context:
space:
mode:
Diffstat (limited to 'progs/fp')
-rwxr-xr-xprogs/fp/Makefile1
-rw-r--r--progs/fp/SConscript15
-rw-r--r--progs/fp/fp-tri.c15
-rw-r--r--progs/fp/mov-imm.txt3
-rw-r--r--progs/fp/mov-param.txt4
-rw-r--r--progs/fp/point-position.c2
-rw-r--r--progs/fp/tri-depth.c2
-rw-r--r--progs/fp/tri-depth2.c2
-rw-r--r--progs/fp/tri-depthwrite.c2
-rw-r--r--progs/fp/tri-depthwrite2.c2
-rw-r--r--progs/fp/tri-inv.c2
-rw-r--r--progs/fp/tri-param.c2
-rw-r--r--progs/fp/tri-tex.c2
13 files changed, 31 insertions, 23 deletions
diff --git a/progs/fp/Makefile b/progs/fp/Makefile
index 681928cf26..d77cd32b4d 100755
--- a/progs/fp/Makefile
+++ b/progs/fp/Makefile
@@ -17,6 +17,7 @@ SOURCES = \
tri-depth2.c \
tri-depthwrite.c \
tri-depthwrite2.c \
+ tri-inv.c \
tri-param.c \
fp-tri.c
diff --git a/progs/fp/SConscript b/progs/fp/SConscript
index a78318542c..113e11ab54 100644
--- a/progs/fp/SConscript
+++ b/progs/fp/SConscript
@@ -1,15 +1,4 @@
-Import('env')
-
-if not env['GLUT']:
- Return()
-
-env = env.Clone()
-
-env.Prepend(CPPPATH = [
- '../util',
-])
-
-env.Prepend(LIBS = ['$GLUT_LIB'])
+Import('*')
progs = [
'fp-tri',
@@ -24,7 +13,7 @@ progs = [
]
for prog in progs:
- env.Program(
+ progs_env.Program(
target = prog,
source = [prog + '.c'],
)
diff --git a/progs/fp/fp-tri.c b/progs/fp/fp-tri.c
index 52a8fcfc22..70676d4c40 100644
--- a/progs/fp/fp-tri.c
+++ b/progs/fp/fp-tri.c
@@ -73,7 +73,7 @@ static void Init( void )
GLuint Texture;
GLint errno;
GLuint prognum;
- char buf[4096];
+ char buf[50000];
GLuint sz;
FILE *f;
@@ -176,6 +176,17 @@ static void Init( void )
}
+ {
+ const float Ambient[4] = { 0.0, 1.0, 0.0, 0.0 };
+ const float Diffuse[4] = { 1.0, 0.0, 0.0, 0.0 };
+ const float Specular[4] = { 0.0, 0.0, 1.0, 0.0 };
+ const float Emission[4] = { 0.0, 0.0, 0.0, 1.0 };
+ glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, Ambient);
+ glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, Diffuse);
+ glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, Specular);
+ glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, Emission);
+ }
+
glClearColor(.1, .3, .5, 0);
}
@@ -197,7 +208,7 @@ static void Key(unsigned char key, int x, int y)
case 27:
exit(1);
default:
- return;
+ break;
}
glutPostRedisplay();
diff --git a/progs/fp/mov-imm.txt b/progs/fp/mov-imm.txt
new file mode 100644
index 0000000000..38e48079d0
--- /dev/null
+++ b/progs/fp/mov-imm.txt
@@ -0,0 +1,3 @@
+!!ARBfp1.0
+MOV result.color, {0.5, 0.8, 0.3, 1.0};
+END
diff --git a/progs/fp/mov-param.txt b/progs/fp/mov-param.txt
new file mode 100644
index 0000000000..13d82fe00b
--- /dev/null
+++ b/progs/fp/mov-param.txt
@@ -0,0 +1,4 @@
+!!ARBfp1.0
+PARAM Diffuse = state.material.diffuse;
+MOV result.color, Diffuse;
+END
diff --git a/progs/fp/point-position.c b/progs/fp/point-position.c
index c0963d7a0b..1ae753c1d0 100644
--- a/progs/fp/point-position.c
+++ b/progs/fp/point-position.c
@@ -55,7 +55,7 @@ static void Key(unsigned char key, int x, int y)
case 27:
exit(1);
default:
- return;
+ break;
}
glutPostRedisplay();
diff --git a/progs/fp/tri-depth.c b/progs/fp/tri-depth.c
index 5488469e80..a9f3a6a5be 100644
--- a/progs/fp/tri-depth.c
+++ b/progs/fp/tri-depth.c
@@ -57,7 +57,7 @@ static void Key(unsigned char key, int x, int y)
case 27:
exit(1);
default:
- return;
+ break;
}
glutPostRedisplay();
diff --git a/progs/fp/tri-depth2.c b/progs/fp/tri-depth2.c
index 6ed2307115..8c4336817b 100644
--- a/progs/fp/tri-depth2.c
+++ b/progs/fp/tri-depth2.c
@@ -59,7 +59,7 @@ static void Key(unsigned char key, int x, int y)
case 27:
exit(1);
default:
- return;
+ break;
}
glutPostRedisplay();
diff --git a/progs/fp/tri-depthwrite.c b/progs/fp/tri-depthwrite.c
index 8e4f3e6245..7b9d70f292 100644
--- a/progs/fp/tri-depthwrite.c
+++ b/progs/fp/tri-depthwrite.c
@@ -55,7 +55,7 @@ static void Key(unsigned char key, int x, int y)
case 27:
exit(1);
default:
- return;
+ break;
}
glutPostRedisplay();
diff --git a/progs/fp/tri-depthwrite2.c b/progs/fp/tri-depthwrite2.c
index 3c0b4d30c9..599949551d 100644
--- a/progs/fp/tri-depthwrite2.c
+++ b/progs/fp/tri-depthwrite2.c
@@ -55,7 +55,7 @@ static void Key(unsigned char key, int x, int y)
case 27:
exit(1);
default:
- return;
+ break;
}
glutPostRedisplay();
diff --git a/progs/fp/tri-inv.c b/progs/fp/tri-inv.c
index 7e8d8c5ce2..7e490fa61c 100644
--- a/progs/fp/tri-inv.c
+++ b/progs/fp/tri-inv.c
@@ -56,7 +56,7 @@ static void Key(unsigned char key, int x, int y)
case 27:
exit(1);
default:
- return;
+ break;
}
glutPostRedisplay();
diff --git a/progs/fp/tri-param.c b/progs/fp/tri-param.c
index 57443d71bd..26a804d4b3 100644
--- a/progs/fp/tri-param.c
+++ b/progs/fp/tri-param.c
@@ -54,7 +54,7 @@ static void Key(unsigned char key, int x, int y)
case 27:
exit(1);
default:
- return;
+ break;
}
glutPostRedisplay();
diff --git a/progs/fp/tri-tex.c b/progs/fp/tri-tex.c
index 1dbbb201ce..64299e9453 100644
--- a/progs/fp/tri-tex.c
+++ b/progs/fp/tri-tex.c
@@ -76,7 +76,7 @@ static void Key(unsigned char key, int x, int y)
case 27:
exit(1);
default:
- return;
+ break;
}
glutPostRedisplay();