views:

19

answers:

1

Edit:ok, sorry, I had a simple programming error, is there a way to delete this question?

I have some compressed textures that are PVR files, but I cant seem to draw them in my iPad application using OpenGL ES.

I can draw PNG files just fine, I know the PVR files are being loaded correctly. Are there some special OpenGL draw functions that I need to be calling to draw the PVR files?

Edit:All I get is a white image.

Any info is appreciated.

A: 

Drawing PVRTC textures should be exactly the same as any other texture format - it looks more likely that your loading code is the problem. Are any GL errors being reported during loading?

The major difference to loading uncompressed textures are in the line:

glCompressedTexImage2D(GL_TEXTURE_2D, level, GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG, width, height, 0, size, data);

or

glCompressedTexImage2D(GL_TEXTURE_2D, level, GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG, width, height, 0, size, data);

Make sure that you're not setting a GL filter mode to use MIPmaps if they're not in the texture as well.

Searching for PVRTC in Apple's docs brings up a decent summary of how to use these textures.

gmaclachlan