Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenGL 3.2 context on a Carbon window (OS Lion, Mono)

I'm trying to add modern OS X support to OpenTK framework. Mac OS Lion supports OpenGL 3.2 Core context. I can successfully obtain it by using CGL. However, I can't find a straight way to bind the context to a Carbon window.

Previous OpenTK implementation used aglSetDrawable method. CGL doesn't publicly have an alternative, even though it has a similar undocumented CGLSetSurface. Any attempts to use it return error code 1001, which I can't find a description for.

Any help of getting GL 3.2 on a Carbon window?

like image 247
kvark Avatar asked Aug 12 '11 13:08

kvark


1 Answers

I can't say I have tried this, but you might be able to get it to work by using a HICocoaView containing an NSOpenGLView (which will take an NSOpenGLContext that can be created froma CGLContext).

AGL itself is deprecated and unlikely to receive any further updates from Apple. CGL is not intended for windowed contexts. In the long run, using Cocoa is the best route on OS X.

like image 53
Stefan Werner Avatar answered Oct 05 '22 03:10

Stefan Werner