Skip to content
Snippets Groups Projects
Commit 968c8426 authored by Ken Martin's avatar Ken Martin Committed by Kitware Robot
Browse files

Merge topic 'add_sharing_context'


de644aba Add support for sharing a context with a generic window

Acked-by: default avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !7210
parents 67f22c3f de644aba
No related branches found
No related tags found
No related merge requests found
...@@ -15,6 +15,7 @@ PURPOSE. See the above copyright notice for more information. ...@@ -15,6 +15,7 @@ PURPOSE. See the above copyright notice for more information.
#include "vtkWin32OpenGLRenderWindow.h" #include "vtkWin32OpenGLRenderWindow.h"
#include "vtkCommand.h" #include "vtkCommand.h"
#include "vtkGenericOpenGLRenderWindow.h"
#include "vtkIdList.h" #include "vtkIdList.h"
#include "vtkImageData.h" #include "vtkImageData.h"
#include "vtkNew.h" #include "vtkNew.h"
...@@ -1089,6 +1090,23 @@ void vtkWin32OpenGLRenderWindow::Initialize(void) ...@@ -1089,6 +1090,23 @@ void vtkWin32OpenGLRenderWindow::Initialize(void)
this->GetState()->SetVBOCache(renWin->GetVBOCache()); this->GetState()->SetVBOCache(renWin->GetVBOCache());
} }
} }
else
{
// when sharing with a Generic window we rely on
// the generic window context being current
vtkGenericOpenGLRenderWindow* grenWin =
vtkGenericOpenGLRenderWindow::SafeDownCast(this->SharedRenderWindow);
grenWin->MakeCurrent();
HGLRC current = wglGetCurrentContext();
if (grenWin && current)
{
bool result = wglShareLists(current, this->ContextId) == TRUE;
if (result)
{
this->GetState()->SetVBOCache(grenWin->GetVBOCache());
}
}
}
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment