Advertisement

Texture isnt working

Started by October 10, 2003 03:52 AM
1 comment, last by Eponick 21 years, 4 months ago
I cant map my texture for some reason, the one that came with the tutorial maps just fine though, is there something special that was done with this bitmap? Im trying to make my texture in MS Paint =P
int DrawGLScene(GLvoid)
{
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	glLoadIdentity();

	glTranslatef( -29.4f, 20.7f, -50.0f);

	glBindTexture(GL_TEXTURE_2D, texture[0]);


	glBegin(GL_QUADS);
		glTexCoord2f(0.0f, 1.0f);		glVertex3f( 0.0f,  0.0f, 0.0f);		//TL
		glTexCoord2f(0.0f, 0.0f);		glVertex3f( 0.0f, -41.4f, 0.0f);	//BL
		glTexCoord2f(1.0f, 0.0f);		glVertex3f( 60.0f,-41.4f, 0.0f);	//BR
		glTexCoord2f(1.0f, 1.0f);		glVertex3f( 60.0f, 0.0f, 0.0f);		//TR
	glEnd();

	return true;
} 
Lead ProgrammerDawn of Daria
Have you enabled 2D texture mapping using glEnable(GL_TEXTURE_2D)?

--------------------------------------------------------

"If it looks good, it is good computer graphics"
"If it looks like computer graphics, it is bad computer graphics"

Corrail
corrail@gmx.at
ICQ#59184081
--------------------------------------------------------There is a theory which states that if ever anybody discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable.There is another theory which states that this has already happened...
Advertisement
Are you saving the image as a 8bit or 24 bit bmp, it should be 24.
And make shure your width and length is a power of two(1,2,4,8,16,32,64,128,256,512........).

This topic is closed to new replies.

Advertisement