summaryrefslogtreecommitdiff
path: root/progs/fp
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2009-06-11 13:19:34 +0100
committerJosé Fonseca <jfonseca@vmware.com>2009-06-11 13:19:34 +0100
commite3f14f2f3bdd66400d02f0f9076593db609874a8 (patch)
tree32d57f10952a453fcd19ef884d6eb821e1069727 /progs/fp
parent48d816b8fff5d01b8c35bd2f933220e41d976e4c (diff)
progs: Port fp programs to GLEW.
Diffstat (limited to 'progs/fp')
-rw-r--r--progs/fp/SConscript19
-rw-r--r--progs/fp/fp-tri.c2
-rw-r--r--progs/fp/point-position.c7
-rw-r--r--progs/fp/tri-depth.c9
-rw-r--r--progs/fp/tri-depth2.c7
-rw-r--r--progs/fp/tri-depthwrite.c6
-rw-r--r--progs/fp/tri-depthwrite2.c6
-rw-r--r--progs/fp/tri-inv.c6
-rw-r--r--progs/fp/tri-param.c8
-rw-r--r--progs/fp/tri-tex.c6
10 files changed, 50 insertions, 26 deletions
diff --git a/progs/fp/SConscript b/progs/fp/SConscript
index 553799758b0..a78318542c1 100644
--- a/progs/fp/SConscript
+++ b/progs/fp/SConscript
@@ -11,7 +11,20 @@ env.Prepend(CPPPATH = [
env.Prepend(LIBS = ['$GLUT_LIB'])
-env.Program(
- target = 'fp-tri',
- source = ['fp-tri.c'],
+progs = [
+ 'fp-tri',
+ 'tri-depth',
+ 'tri-depth2',
+ 'tri-depthwrite',
+ 'tri-depthwrite2',
+ 'tri-inv',
+ 'tri-param',
+ 'tri-tex',
+ 'point-position',
+]
+
+for prog in progs:
+ env.Program(
+ target = prog,
+ source = [prog + '.c'],
)
diff --git a/progs/fp/fp-tri.c b/progs/fp/fp-tri.c
index 6c15540d38d..52a8fcfc22a 100644
--- a/progs/fp/fp-tri.c
+++ b/progs/fp/fp-tri.c
@@ -89,7 +89,7 @@ static void Init( void )
}
fprintf(stderr, "%.*s\n", sz, buf);
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
+ if (!GLEW_ARB_fragment_program) {
printf("Error: GL_ARB_fragment_program not supported!\n");
exit(1);
}
diff --git a/progs/fp/point-position.c b/progs/fp/point-position.c
index c352a939cb1..c0963d7a0b5 100644
--- a/progs/fp/point-position.c
+++ b/progs/fp/point-position.c
@@ -2,9 +2,8 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
-#include "GL/gl.h"
@@ -17,7 +16,7 @@ static void Init( void )
;
GLuint modulateProg;
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
+ if (!GLEW_ARB_fragment_program) {
printf("Error: GL_ARB_fragment_program not supported!\n");
exit(1);
}
@@ -109,6 +108,8 @@ int main(int argc, char **argv)
exit(1);
}
+ glewInit();
+
Init();
glutReshapeFunc(Reshape);
diff --git a/progs/fp/tri-depth.c b/progs/fp/tri-depth.c
index a1f0579c8e1..5488469e806 100644
--- a/progs/fp/tri-depth.c
+++ b/progs/fp/tri-depth.c
@@ -2,9 +2,8 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
-#include "GL/gl.h"
@@ -19,7 +18,7 @@ static void Init( void )
;
GLuint modulateProg;
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
+ if (!GLEW_ARB_fragment_program) {
printf("Error: GL_ARB_fragment_program not supported!\n");
exit(1);
}
@@ -89,8 +88,6 @@ int main(int argc, char **argv)
glutInit(&argc, argv);
-
-
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
type = GLUT_RGB;
@@ -101,6 +98,8 @@ int main(int argc, char **argv)
exit(1);
}
+ glewInit();
+
Init();
glutReshapeFunc(Reshape);
diff --git a/progs/fp/tri-depth2.c b/progs/fp/tri-depth2.c
index f3096282833..6ed23071157 100644
--- a/progs/fp/tri-depth2.c
+++ b/progs/fp/tri-depth2.c
@@ -2,9 +2,8 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
-#include "GL/gl.h"
@@ -21,7 +20,7 @@ static void Init( void )
;
GLuint modulateProg;
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
+ if (!GLEW_ARB_fragment_program) {
printf("Error: GL_ARB_fragment_program not supported!\n");
exit(1);
}
@@ -106,6 +105,8 @@ int main(int argc, char **argv)
exit(1);
}
+ glewInit();
+
Init();
glutReshapeFunc(Reshape);
diff --git a/progs/fp/tri-depthwrite.c b/progs/fp/tri-depthwrite.c
index fedeec4577d..8e4f3e62451 100644
--- a/progs/fp/tri-depthwrite.c
+++ b/progs/fp/tri-depthwrite.c
@@ -2,7 +2,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
@@ -16,7 +16,7 @@ static void Init(void)
;
GLuint modulateProg;
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
+ if (!GLEW_ARB_fragment_program) {
printf("Error: GL_ARB_fragment_program not supported!\n");
exit(1);
}
@@ -97,6 +97,8 @@ int main(int argc, char **argv)
exit(1);
}
+ glewInit();
+
Init();
glutReshapeFunc(Reshape);
diff --git a/progs/fp/tri-depthwrite2.c b/progs/fp/tri-depthwrite2.c
index 5547092ec9b..3c0b4d30c97 100644
--- a/progs/fp/tri-depthwrite2.c
+++ b/progs/fp/tri-depthwrite2.c
@@ -2,7 +2,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
@@ -16,7 +16,7 @@ static void Init(void)
;
GLuint modulateProg;
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
+ if (!GLEW_ARB_fragment_program) {
printf("Error: GL_ARB_fragment_program not supported!\n");
exit(1);
}
@@ -97,6 +97,8 @@ int main(int argc, char **argv)
exit(1);
}
+ glewInit();
+
Init();
glutReshapeFunc(Reshape);
diff --git a/progs/fp/tri-inv.c b/progs/fp/tri-inv.c
index e9023323862..7e8d8c5ce29 100644
--- a/progs/fp/tri-inv.c
+++ b/progs/fp/tri-inv.c
@@ -2,7 +2,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
@@ -17,7 +17,7 @@ static void Init( void )
;
GLuint modulateProg;
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
+ if (!GLEW_ARB_fragment_program) {
printf("Error: GL_ARB_fragment_program not supported!\n");
exit(1);
}
@@ -99,6 +99,8 @@ int main(int argc, char **argv)
exit(1);
}
+ glewInit();
+
Init();
glutReshapeFunc(Reshape);
diff --git a/progs/fp/tri-param.c b/progs/fp/tri-param.c
index f3e55af3f1b..57443d71bd0 100644
--- a/progs/fp/tri-param.c
+++ b/progs/fp/tri-param.c
@@ -2,9 +2,9 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
-#include "GL/gl.h"
+
static void Init( void )
{
@@ -15,7 +15,7 @@ static void Init( void )
;
GLuint modulateProg;
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
+ if (!GLEW_ARB_fragment_program) {
printf("Error: GL_ARB_fragment_program not supported!\n");
exit(1);
}
@@ -104,6 +104,8 @@ int main(int argc, char **argv)
exit(1);
}
+ glewInit();
+
Init();
glutReshapeFunc(Reshape);
diff --git a/progs/fp/tri-tex.c b/progs/fp/tri-tex.c
index 87f63894ce9..1dbbb201cef 100644
--- a/progs/fp/tri-tex.c
+++ b/progs/fp/tri-tex.c
@@ -3,7 +3,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
#include "readtex.c"
@@ -23,7 +23,7 @@ static void Init( void )
GLuint modulateProg;
GLuint Texture;
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
+ if (!GLEW_ARB_fragment_program) {
printf("Error: GL_ARB_fragment_program not supported!\n");
exit(1);
}
@@ -120,6 +120,8 @@ int main(int argc, char **argv)
exit(1);
}
+ glewInit();
+
Init();
glutReshapeFunc(Reshape);