//------------ 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);
How to setup the parameters for facades
Hello all,
I'm beginner to OpenGL.
I would like to draw a wall look like this:
I have setup some OpenGL parameters like this:
But I don't know how to continue. Could you please help me?
Thanks,
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement