summaryrefslogtreecommitdiffstats
path: root/progs/glsl/convolutions.c
diff options
context:
space:
mode:
Diffstat (limited to 'progs/glsl/convolutions.c')
-rw-r--r--progs/glsl/convolutions.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/progs/glsl/convolutions.c b/progs/glsl/convolutions.c
index 9b9ee532453..ac71c68235e 100644
--- a/progs/glsl/convolutions.c
+++ b/progs/glsl/convolutions.c
@@ -1,3 +1,10 @@
+/**
+ * Convolution with GLSL.
+ * Note: uses GL_ARB_shader_objects, GL_ARB_vertex_shader, GL_ARB_fragment_shader,
+ * not the OpenGL 2.0 shader API.
+ * Author: Zack Rusin
+ */
+
#define GL_GLEXT_PROTOTYPES
#include "readtex.h"
@@ -227,9 +234,11 @@ static void createProgram(const char *vertProgFile,
glUseProgram(program);
+ /*
assert(glIsProgram(program));
assert(glIsShader(fragShader));
assert(glIsShader(vertShader));
+ */
checkError(__LINE__);
{/*texture*/
@@ -316,6 +325,13 @@ static void menuInit()
static void init()
{
+ if (!glutExtensionSupported("GL_ARB_shader_objects") ||
+ !glutExtensionSupported("GL_ARB_vertex_shader") ||
+ !glutExtensionSupported("GL_ARB_fragment_shader")) {
+ fprintf(stderr, "Sorry, this program requires GL_ARB_shader_objects, GL_ARB_vertex_shader, and GL_ARB_fragment_shader\n");
+ exit(1);
+ }
+
fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
@@ -423,8 +439,6 @@ static void draw()
glPopMatrix();
- glFlush();
-
glutSwapBuffers();
}