Jump to content
  • Advertisement

Archived

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

SeanHowe

OpenGL OpenGL texture mapping

This topic is 6935 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

Hi all. I''m having some troubles with OGL texture mapping. Mainly, it seems not to be displaying the texture on polygons I render. In this following code, ''texture'' is an instance of a class that has a member also named ''texture'' that is a GLuint and holds the texture number/id. ''v'' is an instance of a vertex class that holds color/texture/position info. Any ideas on why this isn''t working? (note, this is a member function, and, glBegin, etc, have been called b4 it''s called. It displays a triangle on the screen, it''s simply not textured.)
		if (texture!=NULL)
			glBindTexture(GL_TEXTURE_2D, texture->texture);
	

		for(i=0;i<3;i++)
		{
			if (texture==NULL) 
				glColor4f(v.r,v[i].g,v[i].b,v[i].a);
			glTexCoord2f(v[i].u, v[i].v);
			glVertex3f(v[i].x, v[i].y, v[i].z);
		}
 
Bunnies At War - A new wave in bunnydom! http://users.moscow.com/rikhowe/baw/bunny.html

Share this post


Link to post
Share on other sites
Advertisement
Ahh.. nevermind, solved the problem with the help of some people on the gdnet irc channel

Bunnies At War - A new wave in bunnydom! http://users.moscow.com/rikhowe/baw/bunny.html

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!