ops…
hello there!!!
i’m having some problems with textures. Can some good soul help with this code ???
i’m waiting for your important reply
What i’m doing is something like this:
(Where FPrimitiveTexture[] is a vector 0…2 of TGLuint and my own Primitive Object Field )
TextureImage : PTAUX_RGBImageRec;
glGenTextures( 2, FPrimitiveTexture[0] );
// Create Nearest Filtered Texture
glGenTextures(3, FPrimitiveTexture[0]);
glBindTexture(GL_TEXTURE_2D, FPrimitiveTexture[0]);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);
glTexImage2D(GL_TEXTURE_2D, 0, 3, TextureImage^.sizeX, TextureImage^.sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, TextureImage^.data);
// Create Linear Filtered Texture
glBindTexture(GL_TEXTURE_2D, FPrimitiveTexture[1]);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, 3, TextureImage^.sizeX, TextureImage^.sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, TextureImage^.data);
// Create MipMapped Texture
glBindTexture(GL_TEXTURE_2D, FPrimitiveTexture[2]);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST);
gluBuild2DMipmaps(GL_TEXTURE_2D, 3, TextureImage^.sizeX, TextureImage^.sizeY, GL_RGB, GL_UNSIGNED_BYTE, TextureImage^.data);
at the end of whole process above the vector FPrimitiveTexture still are ( 0, 0, 0 );
what’s happend ?
thanks!!!
_ _
0 0
.
_