[QOpenGLWidget] Add several textutes to line
-
Hello!
I have to output several network stream 1920x1080@25, I use qt-5.5.1.
Now I use QGraphicsView, follow my code:
// initilaize
_scene = new QGraphicsScene;
ui->image->setViewport(new QOpenGLWidget(this));
ui->image->setViewportUpdateMode(QGraphicsView::SmartViewportUpdate);
ui->image->setScene(_scene);
// add image
_image[pos] = _scene->addPixmap(QPixmap::fromImage(image));
_image[pos]->setOffset(pos * 1920, 0);
All work, but very slow.For improve performance I think use qopenglwidget, but I not understand how can I set texture position, I should output image in line. Or may be I can solve with QGraphicsScene?
Can you help me?Thank you excuse my bad english.
-
Ok, I think QGLContext::drawTexture() can solve my problem.
Unfortunately now I always have incorrect QOpenGLContext.
glxinfo output:
name of display: :0.1
display: :0 screen: 0
direct rendering: Yes
server glx vendor string: NVIDIA Corporation
server glx version string: 1.4
................
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce GTX 650 Ti/PCIe/SSE2
OpenGL version string: 4.4.0 NVIDIA 331.67
OpOpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce GTX 650 Ti/PCIe/SSE2
OpenGL version string: 4.4.0 NVIDIA 331.67
OpenGL shading language version string: 4.40 NVIDIA via Cg compiler