for anyone who likes a challange...

this is my semi-finished code for loading a bmp, but when linking i get… error LNK2001: unresolved external symbol _auxDIBImageLoadA@4 … any ideas??

void LoadTexture(patch *tmp)
{

glGenTextures(1, &tmp->Texture);					// Generate 1 Texture

ifstream inputFile(tmp->TexFilename);

tmp->TextureImage = NULL;


if (!(inputFile))
{
	delete tmp->TextureImage;
	exit(0);
}
else
{
	inputFile.close();										// Close The File
	tmp->TextureImage = auxDIBImageLoad(tmp->TexFilename);		// And Load The Texture
}


	// Typical Texture Generation Using Data From The Bitmap
	glBindTexture(GL_TEXTURE_2D, tmp->Texture);

		// Generate The Texture
	glTexImage2D(GL_TEXTURE_2D,						// 2D texture
						0,							// Detail level
						3,							// No. of components (RGB)
						tmp->TextureImage->sizeX,// Dimensions of texture
						tmp->TextureImage->sizeY, 
						0,	
						GL_RGB,						// Using RGB 
						GL_UNSIGNED_BYTE,			// Made up of UB's
						tmp->TextureImage->data);// Position of actual data

glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); // Linear Filtering
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); // Linear Filtering

if (tmp->TextureImage->data)
delete tmp->TextureImage->data;

}

Yes =)

You have to link the libary wich contains the funktion (in your case auxDIBImageLoad()) to your project!

i thing it’s the glaux.lib (Don’t hit me for that, i’m at work and can’t take a fast look)

arrrrrrg I cant belive i missed that! previously the program had been running so I didnt think that id need another lib file.

arrg I think ill blame Microsoft to make me feel better :stuck_out_tongue:

of course, you could write your own bmp loader, but i guess it’s not as portable?

(i just hate aux anything)

thanx for all you help. I have got it going now, but for some reason my whole scene has change to a darker color. any ideas?

the whole scene is darker? your bmp, or everything you draw?

if it’s just the bitmap then i’d suggest you’re casting your pixels to a higher integer. i mean, if your bitmap is stored n GL_UNSIGNED_BYTE and you cast the RGB to GLU_UNSIGNED_INT, then you’re going to end up with a markedly darker image.

just an idea

cheers,
John

It is my whole image that appears darker. Im just playing around now, and if i delete these lines:

glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); // Linear Filtering
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); // Linear Filtering
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);

Then it works. I do know that these may not be the actual problem, but if anyone has any ideas…

thanks

Does it appear that the texture could be blending with the color of the objects? Try using

glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);

(Or GL_REPLACE instead of GL_DECAL)

Hmmmm that didnt work. Thanks for you help though. :eek: :stuck_out_tongue: