Ollhax's picture

Cocoa bindings for OpenTK (Mac)

Hi 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?


Comment viewing options

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

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.