Salut a tous,
je comprend pas pourquoi mon code ne marche pas. l'ereur est la suivante :
Erreur 2 error C2664: 'auxDIBImageLoadW' : impossible de convertir le paramètre 1 de 'const char [7]' en 'LPCWSTR'
void COpenGLView::LoadMyTexture()
{
//GLuint texture[1]; //Storage For One Texture
AUX_RGBImageRec *TextureImage[1];// create Storage Space For the texture
FILE *File;
File=fopen(FILENAME,"r");
//We clear the image record to make sure it's empty.
memset(TextureImage,0,sizeof(void *)*1);
//Does the file exist?
if (File)
{
fclose(File);
// if the Bitmap is correcty Loaded into texture map
if (TextureImage[0]=auxDIBImageLoad(FILENAME))
{
//Create the Texture
glGenTextures(1, &texture[0]);
// Typical Texture Generation using date from the bitmap
glBindTexture(GL_TEXTURE_2D, texture[0]);
//Generate the texture
glTexImage2D(GL_TEXTURE_2D, /*2D texture Type*/
0, /* Mipmap : nothing*/
3, /*Colors : 3*/
TextureImage[1]->sizeX, /*width of image*/
TextureImage[1]->sizeY, /*height of image*/
0, /*widht edge*/
GL_RGB, /*RGBA format*/
GL_UNSIGNED_BYTE, /*colors type*/
TextureImage[1]->data); /*adress's image*/
// Linear filtering
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,GL_LINEAR);
// Linear filtering
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER,GL_LINEAR);
}
}
if (TextureImage[0])
{
if (TextureImage[0]->data)
{
free(TextureImage[0]->data);
}
free(TextureImage[0]);
}
}
merci.
Partager