# can VTK work width opengl desktop and qt5 quick?

**URL:** https://discourse.vtk.org/t/can-vtk-work-width-opengl-desktop-and-qt5-quick/13051
**Category:** Support
**Created:** [January 11, 2024, 5:44am UTC](https://discourse.vtk.org/t/can-vtk-work-width-opengl-desktop-and-qt5-quick/13051 "2024-01-11T05:44:55Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![nocanstillbb](https://discourse.vtk.org/user_avatar/discourse.vtk.org/nocanstillbb/32/8261_2.png) [@nocanstillbb](https://discourse.vtk.org/u/nocanstillbb)
#### Post date: [January 11, 2024, 5:44am UTC](https://discourse.vtk.org/t/can-vtk-work-width-opengl-desktop-and-qt5-quick/13051/1 "2024-01-11T05:44:55Z")

</div>

i have opengl 3.0 desktop + qml program like this :[Scene Graph - Rendering FBOs in a thread | Qt Quick 5.15.16](https://doc.qt.io/qt-5/qtquick-scenegraph-textureinthread-example.html)  
I use it play video ,it was work well.

when i set vtk graphicsBackend  
QQuickVTKRenderWindow::setupGraphicsBackend();

qml backend will set opengl version to opengl ES version.

my custome video control base on FBO will not work.,

I try to build vtk with some opengl2 options and change openGL version in `QQuickVTKRenderWindow::setupGraphicsBackend` , both are no effect

how can i make its work together?

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [January 11, 2024, 12:50pm UTC](https://discourse.vtk.org/t/can-vtk-work-width-opengl-desktop-and-qt5-quick/13051/2 "2024-01-11T12:50:13Z")

</div>

Cc: @sankhesh

---

<div class="post-metadata">

### Author: ![sankhesh](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sankhesh/32/73_2.png) [@sankhesh](https://discourse.vtk.org/u/sankhesh)
#### Post date: [January 12, 2024, 4:55pm UTC](https://discourse.vtk.org/t/can-vtk-work-width-opengl-desktop-and-qt5-quick/13051/3 "2024-01-12T16:55:58Z")

</div>

@nocanstillbb What makes you think that you’re getting the opengles API? In general, vtk and qt both request opengl core API by default.

---

<div class="post-metadata">

### Author: ![nocanstillbb](https://discourse.vtk.org/user_avatar/discourse.vtk.org/nocanstillbb/32/8261_2.png) [@nocanstillbb](https://discourse.vtk.org/u/nocanstillbb)
#### Post date: [January 12, 2024, 5:07pm UTC](https://discourse.vtk.org/t/can-vtk-work-width-opengl-desktop-and-qt5-quick/13051/4 "2024-01-12T17:07:51Z")

</div>

Because my OpenGL shader reports an error when linking to the OpenGL program,

it appears that my Ubuntu OpenGL version is 3.0, which is less than the VTK OpenGL version 3.2, causing this issue.

If I use the environment variable `putenv((char *)"MESA_GL_VERSION_OVERRIDE=3.0");`,

both my OpenGL shader and VTK can work, even though VTK reports many errors telling me that the OpenGL version is too low.

> [@can VTK work width opengl desktop and qt5 quick?](https://discourse.vtk.org/t/can-vtk-work-width-opengl-desktop-and-qt5-quick/13051/3):
>
> @nocanstillbb What makes you think that you’re getting the opengles API? In general, vtk and qt both request opengl core API by default.

---

<div class="post-metadata">

### Author: ![sankhesh](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sankhesh/32/73_2.png) [@sankhesh](https://discourse.vtk.org/u/sankhesh)
#### Post date: [January 12, 2024, 5:20pm UTC](https://discourse.vtk.org/t/can-vtk-work-width-opengl-desktop-and-qt5-quick/13051/5 "2024-01-12T17:20:24Z")

</div>

VTK’s minimum opengl version is Core profile 3.2. Doesn’t mean that it is giving you GLES.

Perhaps, all you need is a graphics driver update.

---

<div class="post-metadata">

### Author: ![nocanstillbb](https://discourse.vtk.org/user_avatar/discourse.vtk.org/nocanstillbb/32/8261_2.png) [@nocanstillbb](https://discourse.vtk.org/u/nocanstillbb)
#### Post date: [January 12, 2024, 5:36pm UTC](https://discourse.vtk.org/t/can-vtk-work-width-opengl-desktop-and-qt5-quick/13051/6 "2024-01-12T17:36:03Z")

</div>

This happens in my Ubuntu 16.04 virtual machine development environment. Typically, we would deploy to devices that already have the graphics card driver installed.

Sincere thanks
