summaryrefslogtreecommitdiffstats
path: root/progs/redbook/histogram.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-02-15 18:04:00 -0700
committerBrian Paul <brianp@vmware.com>2010-02-15 18:04:39 -0700
commitc6e63f3cc235b2d7b06664a493584671a2493045 (patch)
tree9f254c44ea3fc2c999ed78312a775495a82721f2 /progs/redbook/histogram.c
parentbd3829b5f5b204d95d9ac3e5538ca11d0904ba7d (diff)
downloadexternal_mesa3d-c6e63f3cc235b2d7b06664a493584671a2493045.zip
external_mesa3d-c6e63f3cc235b2d7b06664a493584671a2493045.tar.gz
external_mesa3d-c6e63f3cc235b2d7b06664a493584671a2493045.tar.bz2
progs/redbook: use glew
Diffstat (limited to 'progs/redbook/histogram.c')
-rw-r--r--progs/redbook/histogram.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/progs/redbook/histogram.c b/progs/redbook/histogram.c
index 7ddceb6..de1e59e 100644
--- a/progs/redbook/histogram.c
+++ b/progs/redbook/histogram.c
@@ -46,6 +46,7 @@
* use of the glHistogram() function.
*/
+#include <GL/glew.h>
#include <GL/glut.h>
#include <assert.h>
#include <stdlib.h>
@@ -113,6 +114,11 @@ readImage( const char* filename, GLsizei* width, GLsizei *height )
static void init(void)
{
+ if (!glutExtensionSupported("GL_ARB_imaging")) {
+ fprintf(stderr, "Sorry, this program requires GL_ARB_imaging.\n");
+ exit(1);
+ }
+
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glClearColor(0.0, 0.0, 0.0, 0.0);
@@ -192,6 +198,7 @@ int main(int argc, char** argv)
glutInitWindowSize(width, height);
glutInitWindowPosition(100, 100);
glutCreateWindow(argv[0]);
+ glewInit();
init();
glutReshapeFunc(reshape);
glutKeyboardFunc(keyboard);