LWJGL Context and Mac OSX Mavericks

So new lesson for me today.

Mac computers unlike everyone else… default their openGL implementation to 2.1 unless you specifically set your OpenGL profile exactly right… (current mavericks support is actually for opengl 4.1)

So now im struggling to get my settings perfectly right so that the video card actually switches to OpenGL 4.1 mode.

anyone got any experience with this?
sample code would be a blessing :slight_smile:

thanks
j.

solution found… but man this is weird!

ok… here goes

if you want to support a mac you MUST EXPLICITLY select version 3.2 CORE
… oh wait you say… but i thought opengl version 4.1 is the highest it supports…

Well your right… and guess what… when you pick 3.2 it will give you a 4.1 implementation in return

this is verifiable by using glGetString(GL_Version) … so … the real way to find out what version you have access to on a mac is to first select 3.2 then test the string value to see what you really get. (face palm…#1)

now if you actually try to request a GL Context using 4 as the major and 1 as the minor… DING… you get version 2.1 … you MUST use 3.2.

and now for those that have put up with my rant… some useful code :slight_smile:


PixelFormat pixelFormat = new PixelFormat();
ContextAttribs attribs = new ContextAttribs(3,2).withProfileCore(true);
Display.create(pixelFormat, attribs);