From Craig Bosma,"Please find attached a fix for shared contexts on OS X, with the Cocoa backend. The NSOpenGLContext* _context member of GraphicsHandleCocoa was never set on successfully creation, so even if the dynamic_cast to GraphicsHandleCocoa succeeds, we get a bogus (NULL) pointer on retrieving the actual NSOpenGLContext* (line 1013).
This should fix the problem, as well as cause GraphicsWindowCocoa to report the correct name "GraphicsWindowCarbon" -> "GraphicsWindowCocoa". "
This commit is contained in:
@@ -1020,6 +1020,10 @@ bool GraphicsWindowCocoa::realizeImplementation()
|
||||
OSG_WARN << "GraphicsWindowCocoa::realizeImplementation :: could not create context" << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
// set graphics handle for shared usage
|
||||
setNSOpenGLContext(_context);
|
||||
|
||||
GraphicsWindowCocoaGLView* theView = [[ GraphicsWindowCocoaGLView alloc ] initWithFrame:[ _window frame ] ];
|
||||
[theView setAutoresizingMask: (NSViewWidthSizable | NSViewHeightSizable) ];
|
||||
[theView setGraphicsWindowCocoa: this];
|
||||
|
||||
Reference in New Issue
Block a user