PDA

View Full Version : dxt3 / s3tc compression usage



JernejL
12-16-2003, 01:14 PM
i am loading a dds image data this way:

const
RGBA_DXT3 = 33778;

code:

glGenTextures(1, Texture);
glBindTexture(GL_TEXTURE_2D, Texture);

isize:= ((width + 3) div 4) * ((height + 3) div 4) * 8;

glCompressedTexImage2DARB(GL_TEXTURE_2D, 0, RGBA_DXT3,
width, height, 0, isize, pData);

the images created are all white -
after the load texture call i get
glgeterror = $0502

which means
GL_INVALID_OPERATION = $0502;

what am i doing wrong here?
do i need to set up anything else before this?
i have chedked the extension, geforce4 mx
can load dxt compressed images fine..

- how do i create a image from dxt3 compressed data in opengl?

Leyder Dylan
12-18-2003, 04:39 AM
On the NVIDIA website, they have an example for loading DDS file.
http://developer.nvidia.com/

Or, try this link :
http://www.codesampler.com/oglsrc.htm

Search the "DDS Texture Loader" section.