Changeset 12309

Show
Ignore:
Timestamp:
04/26/11 14:05:57 (4 years ago)
Author:
robert
Message:

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?".
"

Location:
OpenSceneGraph/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/include/osgViewer/api/Cocoa/GraphicsWindowCocoa

    r12292 r12309  
    8686        virtual bool isSameKindAs(const Object* object) const { return dynamic_cast<const GraphicsWindowCocoa*>(object)!=0; } 
    8787        virtual const char* libraryName() const { return "osgViewer"; } 
    88         virtual const char* className() const { return "GraphicsWindowCarbon"; } 
     88        virtual const char* className() const { return "GraphicsWindowCocoa"; } 
    8989 
    9090        virtual bool valid() const { return _valid; } 
  • OpenSceneGraph/trunk/src/osgViewer/GraphicsWindowCocoa.mm

    r12292 r12309  
    10211021        return false; 
    10221022    } 
     1023     
     1024    // set graphics handle for shared usage 
     1025    setNSOpenGLContext(_context); 
     1026     
    10231027    GraphicsWindowCocoaGLView* theView = [[ GraphicsWindowCocoaGLView alloc ] initWithFrame:[ _window frame ] ]; 
    10241028    [theView setAutoresizingMask:  (NSViewWidthSizable | NSViewHeightSizable) ];