Qt and OpenGL how to render a PVR

793 Views Asked by At

I'm having a few issues regarding how to render a PVR.

I'm confused about how to get the data from the PVR to screen. I have a window that is ready to draw a picture and I'm a bit stuck. What do I need to get from the PVR as parameters to then be able to draw a texture? With jpeg and pngs locally you can just load the image from a directory but how would the same occur for a PVR?

1

There are 1 best solutions below

3
On

Depends what format the data inside the PVR is in. If it's a supported standard then just copy it to a texture with glTexSubImage2D(), otherwise you will need to decompress it into something OpenGL understands - like RGB or RGBA.

edit - OpenGL is a display library (well much much more than that), it doesn't read images, decode movies or do sound.

TGA files are generally very simple uncompressed RGB or RGBA image data, it should be trivial to decode the file, extract the image data and copy it directly to an opengl texture.

since you tagged the question Qt you can use QImage to load the tga and Using QImage with OpenGL