I've been using the old Qt OpenGl methods but it was about time to switch to the newer ones.
being bitmap a FIBITMAP* properly initialized
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height,0, GL_BGRA,GL_UNSIGNED_BYTE, (void*)FreeImage_GetBits(pImage));
worked like a charm for me.
But now in the newer methods it is preferred to use QOpenGLTexture
Unfortunatly my tries were unsucessful ie.
QOpenGLTexture*qtexture = new QOpenGLTexture(QOpenGLTexture::Target2D);
texture->setData(QOpenGLTexture::PixelFormat::RGBA, QOpenGLTexture::PixelType::Int8,FreeImage_GetBits(bitmap));
that code returns a 1x1 texture but also if I force the size like using
qtexture->setSize(width,height,4);
qtexture has the proper size but it is totally black, also I've tried to search in Qt/Freeimage forums etc but nothing related unfortunatly everyone uses QImage to feed QOpenGLTexture but unfortunatly I need to support some "strange" fileformats like .hdr or .exr that are not supported by Qt itself.
Thank you in advance for your time!