Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Eponick

Texture isnt working

This topic is 5400 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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;
} 

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
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........).

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!