How to setup the parameters for facades

Started by
-1 comments, last by igala net 15 years, 4 months ago
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,
Relax: http://video.igala.netAndroid Core http://androidcore.com

This topic is closed to new replies.

Advertisement