Jump to content
  • Advertisement
Sign in to follow this  
igala net

OpenGL How to setup the parameters for facades

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

Hello all, I'm beginner to OpenGL. I would like to draw a wall look like this: opengl texture.jpg I have setup some OpenGL parameters like this:
//------------ texture

		//
		int textureID[1];
		int texture_w = 4, texture_h = 4;
		unsigned char* texture_data = NULL;

		loadTextureData(texture_data);
		
		glEnableClientState(GL_TEXTURE_COORD_ARRAY);
		glGenTextures  ( 1, textureID );
		glBindTexture  ( GL_TEXTURE_2D,  textureID[0] );
		
		int bpp = 3;
		glTexImage2D   ( GL_TEXTURE_2D,  0, bpp==3 ? GL_RGB : GL_RGBA, texture_w, texture_h, 0, bpp==3 ? GL_RGB : GL_RGBA, GL_UNSIGNED_BYTE, texture_data);
		
		//glTexEnvx      ( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE,   GL_MODULATE); 
		glTexParameterf( GL_TEXTURE_2D,  GL_TEXTURE_MIN_FILTER, GL_NEAREST);
		//glTexParameterf( GL_TEXTURE_2D,  GL_TEXTURE_MIN_FILTER, GL_LINEAR);
		glTexParameterf( GL_TEXTURE_2D,  GL_TEXTURE_MAG_FILTER, GL_NEAREST);
		//glTexParameterf( GL_TEXTURE_2D,  GL_TEXTURE_MAG_FILTER, GL_LINEAR);
		
		glTexCoordPointer( 2, GL_FLOAT, 8*sizeof(float), vertices );
		
		// How to setup the parameters?

		//=======================
		// draw texture here
		//=======================
	
		free(texture_data); // Free The Image Structure
		
		glDeleteTextures(1, textureID);

But I don't know how to continue. Could you please help me? Thanks,

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • 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!