From f40aaca406c3553317d3e03c008840f095be5790 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Pe=C3=B1aranda?= Date: Fri, 25 Jan 2013 15:25:21 -0200 Subject: [PATCH] require glew only on mac --- openglcanvas.cpp | 4 +++- openglcanvas.h | 8 +++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/openglcanvas.cpp b/openglcanvas.cpp index d61036b..566ea51 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 2ca440f..c13215f 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 -- GitLab