Questions tagged [qtopengl]

The QtOpenGL module offers classes that provide a C++ interface to OpenGL in Qt applications.

OpenGL is a standard API for rendering 3D graphics. OpenGL only deals with 3D rendering and provides little or no support for GUI programming issues. The user interface for an OpenGL application must be created with another toolkit, such as Motif on the X platform, Microsoft Foundation Classes (MFC) under Windows, or Qt on both platforms.

Note: OpenGL is a trademark of Silicon Graphics, Inc. in the United States and other countries.

The Qt OpenGL module makes it easy to use OpenGL in Qt applications. It provides an OpenGL widget class that can be used just like any other Qt widget, except that it opens an OpenGL display buffer where you can use the OpenGL API to render the contents.

Reference: http://qt-project.org/doc/qt-4.8/qtopengl.html

98 questions
0
votes
1 answer

Upgrade QT from 5.12 to 6.5, QSGSimpleMaterial and openGL gets removed

I upgraded qt5.12.0 to qt6.5.2, and trying to get code compiled in the new version of qt. In our code we use QSGSimpleMaterial and QSGSimpleMaterialShader, and qt openGL: #include "arcnode.h" #include // QSGSimpleMaterial: No…
Fei Su
  • 1
  • 3
0
votes
0 answers

Why are shaders in a scene with multiple QGraphicsItem drawn in the center of scene and not attached to item?

I want to place in QGraphicsScene several items that draw lines using opengl, when I draw these lines with painter or without shaders, using glBegin(GL_LINES) everything works fine, and the lines are drawn each in its own item. But when I draw with…
0
votes
0 answers

Where to create QOpenGLDebugLogger in a qml application?

I have a Qt6 qml application, and plan to add several QQuickFramebufferObject descendant components to use OpenGL directly. I need OpenGL logs, and I learned that I can use QOpenGLDebugLogger for this. As a PoC, I can create the QOpenGLDebugLogger…
Ferenc
  • 779
  • 1
  • 6
  • 14
0
votes
1 answer

OpenGL program spits out GL_INVALID_OPERATION when I try to set more than 16 uniform locations

I am working on a Qt6 application which features a QOpenGLWidget where I render using some GLSL shaders. I try to use the Qt6 helpers and primitives for OpenGL as much as possible. I set up my context to use OpenGL version 4.6 core and log the…
Mr. Developerdude
  • 9,118
  • 10
  • 57
  • 95
0
votes
0 answers

Fail to allocate OpenGL texture array in Qt6

Given the following code: // Helper to print relevant QOpenGLTexture state QString textureToString(const QOpenGLTexture &textureArray){ QString out=R"END( size: %1x%2 depth: %3 faces: %4 …
Mr. Developerdude
  • 9,118
  • 10
  • 57
  • 95
0
votes
0 answers

Vertex weights are rendered incorrectly in OpenGL

Model in COLLADA format How this cube looks in my app How this cube looks in Blender You can notice that my cube has green points at the bottom while in Blender - it does not. I want to realize what is the problem with my weights, mb problem with…
0
votes
1 answer

OpenGL surfaced Qt 6.5 application window not responding

I tried to run basic OpenGL example in Qt 6.5 where I only create OpenGL surfaced window. Code is short and clear but I can't see what is missing... main.cpp: #include "mainwindow.h" #include int main(int argc, char *argv[]) { …
0
votes
0 answers

How does the main function in vertex shader process every vertex in OpenGL

I create a shader program without defining VBO in Qt with OpenGL, because I define the vertex values in the vextex shader and it did work. Now I have a question, I know the vertex shader will process evert vertex value, but the main function in my…
s Fyantu
  • 11
  • 2
0
votes
0 answers

use a uniform buffer by Qt with OpenGL but it didn't work

I want to use uniform buffer for Matrices of model、view and projection in Qt.I chose QOpenGLExtraFunctions for calling glBindBufferRange function.But I found it no use.My floor.vert and object.vert shows 'model'、'projection' and 'view' were not…
s Fyantu
  • 11
  • 2
0
votes
0 answers

Why is Visual Studio not bringing in the latest changes to my shader files?

I have an c++ application being built with Visual Studio, where I am trying to incorporate using OpenGL through Qt for 3D renderings. When I build my application, the shader files (shader.vert, shader.frag) are included, except it seems that an…
Nick T
  • 63
  • 8
0
votes
1 answer

Why two terminals show different OpenGL versions?

I work on Ubuntu 20.04. I updated graphics drivers and restarted X. I had to upgrade OpenGL since after upgrading drivers the OpenGL version was downgraded for some reason. I opened bash terminal and updated the drivers as described here: sudo…
theateist
  • 13,879
  • 17
  • 69
  • 109
0
votes
0 answers

High CPU usage when using QOpenGLWidget to draw YUV data

I implemented a glRender class which subclassed QOpenGLWidget to display YUV data from a H264 decoder (1920x1080@60fps). The problem is that the OpenGL drawing process takes about 60% of processing power of a single core (observed from output of…
Edmond
  • 143
  • 1
  • 10
0
votes
1 answer

How to decently destroy opengl resources when using QOpenGLWidget in pyqt5

First of all, My codes are as follows: from PyQt5.QtWidgets import QApplication, QOpenGLWidget, QMainWindow from PyQt5.QtGui import QPainter, QOpenGLShader, QOpenGLShaderProgram, QMatrix4x4, QOpenGLBuffer, QOpenGLVertexArrayObject from PyQt5.QtCore…
Finley
  • 795
  • 1
  • 8
  • 26
0
votes
1 answer

qt mouse jumpy when keep mouse centered

i'm trying to make a fps camera while using QOpenGLWidget, gamer will have a CrossCursor in the center of the screen like most games do. But when i use QCursor::setPos(geometry().center()); the cursor is jumpy, and bounces all over; it really…
cooronx
  • 1
  • 1
0
votes
1 answer

How to force Qt to use the OpenGL window type?

The Qt documentation says: When dynamically adding a QOpenGLWidget into a widget hierarchy, e.g. by parenting a new QOpenGLWidget to a widget where the corresponding top-level widget is already shown on screen, the associated native window may get…