I’m having difficulty accessing a texture object. When I choose a texture object that’s already been bound, the texture isn’t being activated and utilized by the texture mapping functions that follow.Here’s a sample of my code.
//generate object IDs
//Set properties of texture object
glPixelStorei( GL_UNPACK_ALIGNMENT, 1 );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER,GL_LINEAR );
glTexParameteri( GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST );
glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
gluBuild2DMipmaps( GL_TEXTURE_2D, 3,
GL_RGB, GL_UNSIGNED_BYTE, m_pRGBImage->data );
If you’re wondering, m_pRGBImage is a pointer to the bitmap data. I know that’s not the problem because I can create mipmaps with this code. It’s the texture objects that don’t work.
Afterwards I tried to access this bitmap as follows.
//call texture object already bound
I expected this code to work, but my functions for mapping textures to curves that followed didn’t use a texture. Can anyone tell me what I’m doing wrong?