diff --git a/include/osgViewer/api/Cocoa/GraphicsWindowCocoa b/include/osgViewer/api/Cocoa/GraphicsWindowCocoa index 076fedb84..54510c074 100644 --- a/include/osgViewer/api/Cocoa/GraphicsWindowCocoa +++ b/include/osgViewer/api/Cocoa/GraphicsWindowCocoa @@ -85,7 +85,7 @@ class GraphicsWindowCocoa : public osgViewer::GraphicsWindow, public osgViewer:: virtual bool isSameKindAs(const Object* object) const { return dynamic_cast(object)!=0; } virtual const char* libraryName() const { return "osgViewer"; } - virtual const char* className() const { return "GraphicsWindowCarbon"; } + virtual const char* className() const { return "GraphicsWindowCocoa"; } virtual bool valid() const { return _valid; } diff --git a/src/osgViewer/GraphicsWindowCocoa.mm b/src/osgViewer/GraphicsWindowCocoa.mm index 94e1eaa8a..ea986eb81 100644 --- a/src/osgViewer/GraphicsWindowCocoa.mm +++ b/src/osgViewer/GraphicsWindowCocoa.mm @@ -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];