rasmusrn's picture

Why do I get OpenGL version 2.1?

Hi everyone,

When I type "#version 130" or higher at the top of my GLSL shaders, and try to compile them I get a compilation error:
ERROR: 0:1: '' : version '130' is not supported.

I figured this might be because I was using an older version of OpenGl for some reason. GL.GetString(StringName.Version) gives me "2.1 APPLE-8.0.61".

I'm using a Macbook Air Mid 2011 with a Intel HD Graphics 3000 graphics card. I've upgraded to Mac OSX 10.8. According to this document I should be able to run OpenGL 3.2, so I tried this to request a 3.2 OpenGL context like this:

namespace OpenTKShaderTest
	public class Game : GameWindow
		public Game() : base(800, 600, GraphicsMode.Default, "My projection test", GameWindowFlags.Default, DisplayDevice.Default, 3, 2, GraphicsContextFlags.Default)

I still see the same version.

I also tried outputting my version with the following code (as suggested here).

int major, minor;
GL.GetInteger(GetPName.MajorVersion, out major);
GL.GetInteger(GetPName.MinorVersion, out minor);

This prints 0.0.

What am I doing wrong? I really want to get on with this so hopefully some of you can help me :)


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
blink9572's picture

I'm still very much a newbie, but also using Apple hardware. I believe the Apple systems (all that I've seen) only support GLSL 1.20 at this time. My proof is from the OpenGL Extensions Viewer "GLview", which is available for free on the Mac App Store, and reports my "Shading language version: 1.20" on the ATI Radeon HD 5870.

rasmusrn's picture

Thank you for replying.

In the OpenGL Extensions Viewer I can select "Core" in the OpenGL profile selector at the top of the screen and it'll show SL version 1.50 (at least that's what the text say). That suggests Mac OSX supports at least this version.

I stumbled upon this related topic today. It seems OpenTK just doesn't (yet) support 3.2 on Mac OSX :(

kanato's picture

Yeah, OpenTK doesn't support GL 3+ on Mac OS X. When I wrote the Mac OS X bindings I was using my Mac Mini, which I bought in 2006. It can't be upgraded to 10.7 and the video hardware doesn't support GL 3 (and at the time, Mac OS didn't support GL 3).