Size of data in glCompressedTexImage2D

Is the imageSize parameter the size of the image data with or without the palette?

I.E. I have a 512KB palette and 128128 bytes of pixels for a total of 16896 bytes. Should I be passing that or just 128128?

I’m pretty sure it’s with palette, but better to be safe than sorry.

Thanks,
Jeremiah

Sorry to double post… couldn’t edit my post.

Noticed another odd behavior… when switching to a compressed image, the entire texture seems to be rotated 180 degrees. At first I thought it was just flipped (as I’m already aware of) but instead it took my flipped data, and rotated over 180 degrees… can’t say I know why…

Yes, you need to pass the total size, including palette data.

On which platform are you seeing the rotation behaviour?

Thanks for the data size answer.

I absolutely should have included that, sorry about that. I’m working with Android, currently only on the SDK Emulator. All OpenGL ES commands are being launched natively through JNI.

I’m getting the graphics data by running both a 24 bit and 8 bit bmp through a quick command line program to just get the raw pixel colors (while converting to RGB565) or palette and pixel indexes. In both cases, I was keeping the pixels in order they’re read which should mean they’re flipped horizontally already which is what I want for the textures. This was fine with 24 bit down to direct 16 bit, but for the 8 bit I had to flip the pixels both horizontally and vertically… (I suppose just read in reverse). If I’ve missed something in my knowledge of bitmap files, please let me know…

I really should have a phone already to test on, but I keep seeing some really nice phones with 1Ghz processors on the horizon, so I’m holding out to do more comparisons…

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.