Changeset 11289

Show
Ignore:
Timestamp:
03/25/10 15:14:46 (4 years ago)
Author:
robert
Message:

From Stephan Huber, "attached you'll find a small enhancement for GraphicsWindowCocoa?. My
submision adds a getter for the pixel-format. I need this for some
custom software so I can integrate CoreVideo?-playback with osg.
"

Location:
OpenSceneGraph/trunk
Files:
2 modified

Legend:

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

    r10887 r11289  
    2626@class GraphicsWindowCocoaGLView; 
    2727@class NSOpenGLContext; 
     28@class NSOpenGLPixelFormat; 
    2829@class NSWindow; 
    2930@class NSView; 
     
    3233class GraphicsWindowCocoaWindow; 
    3334class NSOpenGLContext; 
     35class NSOpenGLPixelFormat; 
    3436class NSWindow; 
    3537class NSView; 
     
    159161        NSOpenGLContext* getContext() { return _context; } 
    160162        GraphicsWindowCocoaWindow* getWindow() { return _window; } 
     163        NSOpenGLPixelFormat* getPixelFormat() { return _pixelformat; } 
    161164                 
    162165        void setVSync(bool f); 
     
    191194        GraphicsWindowCocoaGLView*      _view; 
    192195        NSOpenGLContext*                _context; 
     196        NSOpenGLPixelFormat*            _pixelformat; 
    193197        bool                            _updateContext; 
    194198}; 
  • OpenSceneGraph/trunk/src/osgViewer/GraphicsWindowCocoa.mm

    r11207 r11289  
    858858    _context = NULL; 
    859859    _window = NULL; 
     860    _pixelformat = NULL; 
     861     
    860862    _updateContext = false; 
    861863    _valid = _initialized = true; 
     
    978980    } 
    979981     
    980     NSOpenGLPixelFormat* pixelformat = [[NSOpenGLPixelFormat alloc] initWithAttributes:attr ]; 
    981     _context = [[NSOpenGLContext alloc] initWithFormat: pixelformat shareContext: sharedContext]; 
     982    _pixelformat = [[NSOpenGLPixelFormat alloc] initWithAttributes:attr ]; 
     983    _context = [[NSOpenGLContext alloc] initWithFormat: _pixelformat shareContext: sharedContext]; 
    982984     
    983985    if (!_context) {