Fri 06 Mar 2009 04:01:39 PM UTC, comment #4:
here's a hack of a patch which implements this, works with my test & MyGL and my program, it'll need lots cleaning up
Yeah, i know we need a drawable, but the drawable and the NSView are relatively unrelated except they must share a display.
the views window must be the contexts parent to be displayed in the right place, we can create the drawable before we are attached to an NSView and then reparent it to get the view to draw in the right place...
theres a few ways to work around this, create the windows offscreen on application load
this doesn't help me really, because one of the problems i've run into is that things like NSOutlineView call -reloadData in initWithCoder: which makes writing my dataSources a pain since I have to write checks in every method to see if openGL has been initialized yet, because a call to the renderer before it is initialized will crash it,
the other option is using multiple nib files, this involves creating an NSBox and replacing those for every view which shares a window with my nib, besides that I can't actually look at what my window will look like.
and I cannot change the context after initialization.
I really don't think that there is any proof that the test attached to this bug shouldn't work, and it isn't documented as not working, and this patch should show that it isn't impossible.... anyhow yes, I know it could be worked around but none of those options really appeal to me
(and fwiw I don't really care if it isn't portable because hacking the renderer to use glxGetCurrentContext isn't portable either).
(file #17599)
|