Original Post
Hello everyone. I have a question about texture mapping. I''m totally new to OpenGL (within the last 24 hours kinda new) so please bear with me. I''m on NeHe''s tutorial number 6, about the textured map cube. His demonstration works fine for me. I''ve been able to load another texture that I''ve made onto his rotating cube and everything works great.
So, I got thinking that I would try to make a single quad face, and slap a texture on it just to do my own thing. I thought a title screen logo would be an appropriate example. Instead of using his DrawGLScene() function, I''ve written my own, renderTitleScreen(). Here''s the code for that function:
nt renderTitleScreen(GLvoid) {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glTranslatef(0.0f,0.0f,-5.0f);
glRotatef(g_RotationAngle,0.0f,1.0f,0.0f);
glBindTexture(GL_TEXTURE_2D, texture[0]);
// Texture Mapped Quad--
glBegin(GL_QUADS);
glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f, -1.0f, 1.0f);
glTexCoord2f(1.0f, 0.0f); glVertex3f( 1.0f, -1.0f, 1.0f);
glTexCoord2f(1.0f, 1.0f); glVertex3f( 1.0f, 1.0f, 1.0f);
glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f, 1.0f, 1.0f);
glEnd();
g_RotationAngle+=3.0f;
return TRUE;
}
I don''t recieve any errors regarding the loading of my texture, so I''m assuming this is working fine. The dimensions of the image I am trying to load is 382x87. Just a normal 16bit .bmp file that should be stored in texture[0]. My square displays fine on the screen, but without a texture. I added the rotation to see if maybe the texture was actually on the back of my quad, but this isnt the case either.
I know its hard to diagnose an issue like this out of the context of the rest of the program. Is it because I''m trying to map a non-square texture? Not sure what the key is here. Any input for this n00b would be greatly appreciated.
Thanks very much....