Hi,

I find a lot of way to pass a QImage to GL but in fact i retrieve a gl texture from an API. So i'm trying to convert it either in a QImage or in a QOpenGLTexture to display it. I didn't see any function that could do it. I'm still trying by retrieving the data with glteximage and trying to fill a QImage but i don't know if it will work.

This is my code to display :
Qt Code:
  1. void GLWidget::paintGL()
  2. {
  3. glClearColor(clearColor.redF(), clearColor.greenF(), clearColor.blueF(), clearColor.alphaF());
  4. glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  5.  
  6. QMatrix4x4 m;
  7. m.ortho(-1, 1, +1.f, -01.f, 1.0f, 20.0f);
  8. m.translate(0.0f, 0.0f, -10.0f);
  9. nv.StartCapture();
  10. program->setUniformValue("matrix", m);
  11. program->enableAttributeArray(PROGRAM_VERTEX_ATTRIBUTE);
  12. program->enableAttributeArray(PROGRAM_TEXCOORD_ATTRIBUTE);
  13. program->setAttributeBuffer(PROGRAM_VERTEX_ATTRIBUTE, GL_FLOAT, 0, 3, 5 * sizeof(GLfloat));
  14. program->setAttributeBuffer(PROGRAM_TEXCOORD_ATTRIBUTE, GL_FLOAT, 3 * sizeof(GLfloat), 2, 5 * sizeof(GLfloat));
  15. textures[0]->bind();
  16. glDrawArrays(GL_TRIANGLE_FAN, 0 * 4, 4);
  17. }
To copy to clipboard, switch view to plain text mode 

If you have any idea.
Thanks