Search code examples
openglosx-lionosx-snow-leopardlegacy-code

Where / how do you set kCGLOGLPVersion_Legacy?


I need to use legacy mode for an application that I am porting from Snow Leopard to Lion, to keep the legacy opengl code functioning properly I read that I need to set kCGLOGLPVersion_Legacy for my application profile, or something like that in Appledocumentation https://developer.apple.com/library/mac/#documentation/graphicsimaging/conceptual/OpenGL-MacProgGuide/opengl_pixelformats/opengl_pixelformats.html

I don't know how or where to set this!


Solution

  • You set it using CGLChoosePixelFormat.

    This description of OpenGL Profiles says:

    Discussion An OpenGL Profile is requested as part of the pixel format attributes string. When a context is created for a profile, the context must at least implement the requested version of the OpenGL specification. The context may implement a different version of the OpenGL specification as long as the version it implements is compatible with the requested version.

    You can find a description of CGLChoosePixelFormat here

    Note that you will have to cast kCGLOGLPVersion_Legacy to (CGLPixelFormatAttribute).