
Cocoa bindings for OpenTK (Mac)
Posted Wednesday, 29 August, 2012 - 20:52 by Ollhax inHi there! I'm doing some experimental work on adding support for cocoa windows. It's simply a c++ lib that calls all the Objective C code, and it should be possible to create cocoa windows and such working pretty much as the carbon windows work now.
However, I've hit a snag when it comes to the GLControl. To get stuff rendered using the NSOpenGLContext's setView, I need to pass a NSView. No problem if I create the cocoa windows myself, but what to do for GLControls which are Windows Forms? I assume mono uses carbon internally since the AGL bindings seems to be able to use the handle from the windows form when setting the drawable window.
Is the only answer that you can't get OpenGL with a cocoa backend on a windows form? I know it's a rather strange thing to ask for, but perhaps there's a solution in the MonoMac framework or so? Anyone got any ideas?


Comments
Re: Cocoa bindings for OpenTK (Mac)
Anyhoo, here's the basic attempt: https://github.com/Ollhax/opentk.git
It's pretty rough right now, with only support for creating contexts (i.e. no window handling). Also the aforementioned problem with GLControls remain unsolved, and probably will not be solved unless someone takes the time to replace the Carbon Windows Forms backend in Mono with Cocoa.