PDA

View Full Version : Problems Running Linux GLSL code on Mac



mynameisjohn
11-11-2014, 03:41 PM
Hi All,

I'm trying to get some code I've written for linux working for Mac. However, if I can get a specific example from the Lazyfoo tutorials working then I can apply to to my code.

http://lazyfoo.net/tutorials/SDL/51_SDL_and_modern_opengl/index.php

I have gotten SDL2 and GLEW off of brew. I can compile the example by changing the #include<GL/glu.h> to #include <OpenGL/glu.h> and running

g++ 51_SDL_and_modern_opengl.cpp -framework OpenGL -lSDL2 -lGLEW

The program compiles but I get a black screen. No other code has been changed. I am able to compile the SDL/OpenGL 2 example from Lazyfoo and see the square, but this modern one doesn't seem to work.

Do I have to use the compatibility profile? Not really sure.

output from glGetString(GL_VERSION) and glGetString(GL_SHADING_LANGUAGE_VERSION):

GL version: 3.3 NVIDIA-8.24.16 310.90.9.05f01
GLSL version: 3.30

Edit: Is this true?
http://stackoverflow.com/questions/20264814/glsl-version-130-on-mac-os-x-causes-error