Texturing problem

I have a strange problem with OpenGL. I just can’t bring my polygons to be textured. Here are the steps I take:

Init a float array with red values.
glEnable(GL_TEXTURE_1D);
glTexImage1D() pointing to that array.
Drawing the polygon using glTexCoord*() and glVertex*() for every vertex.

The polygon appears with the color set by glColor*(). Can anyone help?

Are you binding the texture before you draw?
Look at glBindTexture if you’re not…

Hope that helps.

If your trying to texture polygons, you will probably want to use glTexImage2D rather than 1D because 1D textures have a height or width of 1. 1D textures are single pixel high or wide, so thats probably why your not seeing it.

Old GLman

I’ve solved my problem, thanks. I was using one-dimensional textures just to see, if it works, since they are much simpler to code.