From André Garneau, Win32 build fixes

This commit is contained in:
Robert Osfield 2007-02-15 14:04:22 +00:00
parent 3fe4be6e70
commit ed01ae9387
2 changed files with 8 additions and 4 deletions

View File

@ -98,7 +98,7 @@ class GraphicsWindowWin32 : public osgViewer::GraphicsWindow
int getScreenNumberContainingWindow( int& _screenOriginX, int& _screenOriginY );
HGLRC& getWGLContext() { return _hglrc; }
HGLRC getWGLContext() { return _hglrc; }
HWND _hwnd;
HDC _hdc;

View File

@ -1411,13 +1411,17 @@ bool GraphicsWindowWin32::realizeImplementation()
init();
if (!_initialized) return false;
if (_traits.valid && _traits->sharedContext)
if (_traits.valid() && _traits->sharedContext)
{
GraphicsWindowWin32* sharedContextWin32 = dynamic_cast<GraphicsWindowWin32*>(_traits->sharedContext);
if (sharedContextWin32)
{
makeCurrent();
wglShareLists( sharedContextWin32->getWGLContext(), getWGLContext() );
if (!makeCurrent()) return false;
if (!wglShareLists(sharedContextWin32->getWGLContext(), getWGLContext()))
{
reportErrorForScreen("GraphicsWindowWin32::realizeImplementation() - Unable to share OpenGL context", _traits->screenNum, ::GetLastError());
return false;
}
}
}
}