Archive for osx

OpenGL and GLSL support in OS-X

Posted in Twisted Pair with tags , , , , on 2012/08/13 by Adam Griffiths

I had difficulty finding the supported OpenGL and GLSL versions in OS-X.
Using Pyglet, I get errors trying to use versions GLSL 1.30 and above. Printing out the version returns 1.20.

from ctypes import *
from pyglet.gl import *

print "OpenGL version", gl_info.get_version()

plain = string_at(glGetString(GL_SHADING_LANGUAGE_VERSION)).split(' ')[0]
major, minor = map(int, plain.split('.'))
version = major*100 + minor
print "GLSL Version",version

Looking around I found this information.
Mac OS-X OpenGL Support

Legacy would infer the “Fixed Function Pipeline” and Core would be modern OpenGL.
So it seems that legacy OpenGL (normal Pyglet) is stuck with GLSL 1.20 and Core has 1.50.

This code can be found on the Pyglet source repository that enables OpenGL 3 (Core).
Enable OpenGL 3 in Pyglet

But the ouput I get is not correct.

OpenGL version 2.1 ATI-1.0.25
GLSL Version 120

According to this conversation, it appears that Pyglet ignores the OpenGL version on OS-X currently.

%d bloggers like this: