i’m mapping my 3d objects with BITMAP
but whatever what i do with gltexCoord2f
the first pixel of my 256x256 24bit bitmap
is the only color that i se on my objects
AUX_RGBImageRec *TextureImage = NULL;
FILE *file = NULL;
file = fopen(path, “r”);
if (file)
{
fclose(file);
TextureImage =auxDIBImageLoad(path);
this->texture=(unsigned int * )malloc(TextureImage->sizeXTextureImage->sizeY3);
this->width=TextureImage->sizeX;
this->height=TextureImage->sizeY;
this->texture=(unsigned int )malloc(TextureImage->sizeXTextureImage->sizeY3);
memcpy(this->texture,TextureImage->data,TextureImage->sizeXTextureImage->sizeY*3 );
this->path=path;
this->name=path;
}glGenTextures(1, &this->glNumTex);
glPixelStorei (GL_UNPACK_ALIGNMENT, 1);
glBindTexture(GL_TEXTURE_2D, this->glNumTex);
gluBuild2DMipmaps(GL_TEXTURE_2D, 3, this->width, this->height, GL_RGB, GL_UNSIGNED_BYTE, this->texture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, this->width, this->height, 0, GL_RGBA, GL_UNSIGNED_BYTE, this->texture );
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, this->width, this->height,0, GL_RGB, GL_UNSIGNED_BYTE, this->texture);
CTexture::TexturesList.push_back(this);
free(this->texture);
free(TextureImage);
return path;
do you see something wrong with this?