diff --git a/openglcanvas.cpp b/openglcanvas.cpp index d61036b8568632ef49fb69d259bd115e24db23c0..566ea513f277c1fe00c5c2b9aab7d3eee4df7e8c 100644 --- a/openglcanvas.cpp +++ b/openglcanvas.cpp @@ -593,12 +593,14 @@ void OpenGLCanvas::setShaders() { char *vs,*fs; -#ifdef GLEW_VERSION_1_5 +#ifndef __APPLE__ + #ifdef GLEW_VERSION_1_5 GLenum err=glewInit(); if(err!=GLEW_OK){ fprintf(stderr,"error in GLEW initialization: %s\n",glewGetString(err)); exit(-1); } + #endif #endif GLuint v = glCreateShader(GL_VERTEX_SHADER); diff --git a/openglcanvas.h b/openglcanvas.h index 2ca440fccaccb34dd49d9acb1b5ea7bf632c794a..c13215fa91fd4abbdcabb7df3590037eb45fc2fa 100644 --- a/openglcanvas.h +++ b/openglcanvas.h @@ -1,10 +1,12 @@ #ifndef OPENGLCANVAS_H #define OPENGLCANVAS_H -// GLew might not be needed if a recent version of OpenGL is present -#include -#if (!defined GLEW_VERSION_1_5) || (!defined GL_VERSION_3_1) +// GLew might not be needed on mac, or if a recent version of OpenGL is present +#ifndef __APPLE__ + #include + #if (!defined GLEW_VERSION_1_5) || (!defined GL_VERSION_3_1) #error GLEW 1.5.2 is required + #endif #endif #define GL_GLEXT_PROTOTYPES 1