diff --git a/library/src/window_impl.cxx b/library/src/window_impl.cxx index 1b4368c9d9..f3b7b76a1b 100644 --- a/library/src/window_impl.cxx +++ b/library/src/window_impl.cxx @@ -247,8 +247,13 @@ window_impl::window_impl(const options& options, const std::optional& type { oglRenWin->SetOpenGLSymbolLoader(&internals::SymbolLoader, &this->Internals->GetProcAddress); } - // We need to call vtkOpenGLRenderWindow function because vtkGenericOpenGLRenderWindow is reimplementing it incorrectly - oglRenWin->vtkOpenGLRenderWindow::OpenGLInit(); +#if F3D_MODULE_EXTERNAL_RENDERING + if (oglRenWin->IsA("vtkExternalOpenGLRenderWindow")) + { + // We need to call vtkOpenGLRenderWindow function because vtkGenericOpenGLRenderWindow is reimplementing it incorrectly + oglRenWin->vtkOpenGLRenderWindow::OpenGLInit(); + } +#endif } #endif