summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerome Glisse <jglisse@redhat.com>2010-07-13 13:13:07 -0400
committerJohn Doe <glisse@benzedrine.boston.devel.redhat.com>2010-07-13 14:46:45 -0400
commit376984e6bd4205fd17c5f60d7b0a454425a191e1 (patch)
tree707886cb4f998d8c0a5160dcb5474db26e8947b1
parent28684423e4e6cdd4c24b31e331e4a75f9013bb48 (diff)
bezier: use glew and check for ARB_geometry_shader4
This avoid compilation issue with older mesa where ARB_geometry_shader4 is not present.
-rw-r--r--src/gs/Makefile.am2
-rw-r--r--src/gs/gs-tri.c10
2 files changed, 9 insertions, 3 deletions
diff --git a/src/gs/Makefile.am b/src/gs/Makefile.am
index f5151f26..a5a2e280 100644
--- a/src/gs/Makefile.am
+++ b/src/gs/Makefile.am
@@ -7,7 +7,7 @@ AM_LDFLAGS = \
$(GLUT_LIBS)
if HAVE_GLUT
-noinst_PROGRAMS = \
+bin_PROGRAMS = \
gs-tri
endif
diff --git a/src/gs/gs-tri.c b/src/gs/gs-tri.c
index 194a1aa0..c60fff77 100644
--- a/src/gs/gs-tri.c
+++ b/src/gs/gs-tri.c
@@ -8,9 +8,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
-#include <GL/glext.h>
static const char *filename = NULL;
static GLuint nr_steps = 0;
@@ -103,6 +102,12 @@ static void prepare_shaders(void)
" EmitVertex();\n"
" }\n"
"}\n";
+
+ if (!glutExtensionSupported("GL_ARB_geometry_shader4")) {
+ fprintf(stderr, "needs GL_ARB_geometry_shader4 extension\n");
+ exit(1);
+ }
+
fragShader = glCreateShader(GL_FRAGMENT_SHADER);
load_and_compile_shader(fragShader, fragShaderText);
@@ -286,6 +291,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );