0

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?

genpfault
  • 51,148
  • 11
  • 85
  • 139
Bushes
  • 1,010
  • 1
  • 18
  • 37

1 Answers1

2

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

Community
  • 1
  • 1
Martin Beckett
  • 94,801
  • 28
  • 188
  • 263
  • Well I'm trying to load a tga, so how can I get that into something that openGL can recognise. And I'm then confused what data is then needed to then render. I persume the filename isn't enough? – Bushes Nov 29 '11 at 12:42
  • Your links are quite badly chosen, since the second one describes how to draw into a texture (using FBOs and such things) and not how to render a textured quad. And the third link uses `glDrawPixels` which is always a bad idea compared to rendering a textured quad. – Christian Rau Nov 29 '11 at 16:23
  • @Chris, sorry I pasted the wrong tab for the QImage. The others are irrelevent anyway if the OP has Qt – Martin Beckett Nov 29 '11 at 16:28