# How to integrate VTK with OpenGL?

**URL:** https://discourse.vtk.org/t/how-to-integrate-vtk-with-opengl/11526
**Category:** Support
**Tags:** code
**Created:** [May 23, 2023, 3:37pm UTC](https://discourse.vtk.org/t/how-to-integrate-vtk-with-opengl/11526 "2023-05-23T15:37:08Z")
**Posts on this page:** 1
**Showing post:** 10

<div class="post-metadata">

### Author: ![fghoussen](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/f/ecd19e/32.png) [@fghoussen](https://discourse.vtk.org/u/fghoussen)
#### Post date: [May 30, 2023, 3:26pm UTC](https://discourse.vtk.org/t/how-to-integrate-vtk-with-opengl/11526/10 "2023-05-30T15:26:40Z")

</div>

I created a GLFWwindow window.  
I suspect I need to “set” this window into vtkExternalOpenGLRenderWindow: correct? How to do that?

when I Render() on my vtkExternalOpenGLRenderWindow instance, I get:

```auto
X Error of failed request: BadWindow (invalid Window parameter)
  Major opcode of failed request: 3 (X_GetWindowAttributes)
  Resource id in failed request: 0x0
  Serial number of failed request: 8
  Current serial number in output stream: 9

```

When I comment the Render() call line, I get a black empty window (the GLFW one).

---

_[View the full topic](https://discourse.vtk.org/t/how-to-integrate-vtk-with-opengl/11526)._
