Added context sharing support.
This commit is contained in:
@@ -43,8 +43,17 @@ class GraphicsWindowCarbon : public osgViewer::GraphicsWindow
|
||||
if (valid())
|
||||
{
|
||||
setState( new osg::State );
|
||||
getState()->setContextID( osg::GraphicsContext::createNewContextID() );
|
||||
getState()->setGraphicsContext(this);
|
||||
|
||||
if (_traits.valid() && _traits->sharedContext)
|
||||
{
|
||||
getState()->setContextID( _traits->sharedContext->getState()->getContextID() );
|
||||
incrementContextIDUsageCount( getState()->getContextID() );
|
||||
}
|
||||
else
|
||||
{
|
||||
getState()->setContextID( osg::GraphicsContext::createNewContextID() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,6 +104,7 @@ class GraphicsWindowCarbon : public osgViewer::GraphicsWindow
|
||||
|
||||
void transformMouseXY(float& x, float& y);
|
||||
|
||||
AGLContext& getAGLContext() { return _context; }
|
||||
|
||||
bool _valid;
|
||||
bool _initialized;
|
||||
|
||||
@@ -98,6 +98,8 @@ class GraphicsWindowWin32 : public osgViewer::GraphicsWindow
|
||||
|
||||
int getScreenNumberContainingWindow( int& _screenOriginX, int& _screenOriginY );
|
||||
|
||||
HGLRC& getWGLContext() { return _hglrc; }
|
||||
|
||||
HWND _hwnd;
|
||||
HDC _hdc;
|
||||
HGLRC _hglrc;
|
||||
|
||||
@@ -116,7 +116,7 @@ class GraphicsWindowX11 : public osgViewer::GraphicsWindow
|
||||
Display* getEventDisplay() { return _eventDisplay; }
|
||||
Window& getParent() { return _parent; }
|
||||
Window& getWindow() { return _window; }
|
||||
GLXContext getGLXContext() { return _glxContext; }
|
||||
GLXContext& getGLXContext() { return _glxContext; }
|
||||
|
||||
Cursor& getDefaultCursor() { return _defaultCursor; }
|
||||
Cursor& getNullCursor() { return _nullCursor; }
|
||||
|
||||
Reference in New Issue
Block a user