Original Post
To make a long story short, OpenGL ain't texturing my polygons. I can tell it's trying , though. You see, I have something of a terrain grid set up. We have pairs of triangles making rectangles, and those rectangles are in a grid pattern. When the user switches to Textured render mode, they get a dialog box that asks them which bitmap they want to use to texture it. This is the thing. My loading code works find, and the final image data is perfect. I know this because I am rendering the image into a little preview window in the load dialog using a device-independent bitmap. I can tell it's trying to render my texture because I get this faint sort of black "shadow" appearing over my grid when I switch to my texturing mode.
When the user clicks the OK button, it is supposed to take this image and set it up as a texture, and then texture my polygons. The image data is fine, so that's not the problem. Here's everything I'm doing, can't figure out why it isn't working. I've followed NeHe's texture mapping tutorial and borrowed some working code from a friend:
i) Loaded the texture, image data stored in RGB buffer (width * height) in size.
1) Created the texture index with
glGenTextures
2) Bound new texture using glBindTexture
3) Used glTexImage2D to load the image, all options are valid and in sync with both friend's code, docs, and NeHe's tutorial. All parameters are good values.
4) Enabled 2D texture mapping with glEnable(GL_TEXTURE_2D);
5) Rebound the texture with glBindTexture outside the glBegin/glEnd block.
6) Supplied manual texture coordinates for each vertex - gave them bound values like 0.0f and 1.0f just so I'd be able to see any sort of stretch, tweaked these extensively, etc.
7) Just in case, original image data source remains allocated and valid.
I've checked and double-checked everything with my friend's code and all the tutorials I could find, and OGL is being evil. Or I'm just forgetting something. But I don't know what.
[edited by - Zipster on December 19, 2002 4:23:51 AM]