Commit f40aaca4 authored by Luis Peñaranda's avatar Luis Peñaranda

require glew only on mac

parent c9501685
......@@ -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);
......
#ifndef OPENGLCANVAS_H
#define OPENGLCANVAS_H
// GLew might not be needed if a recent version of OpenGL is present
#include <GL/glew.h>
#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 <GL/glew.h>
#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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment