Original Post
I'm trying to learn to do some basic texture mapping, from several different books, but my texture keeps appearing as just white pixels. Here is my relevant code: void init() { glClearColor(0.0, 0.0, 0.0, 0.0); gluOrtho2D(0.0, 400.0, 0.0, 400.0); glShadeModel(GL_FLAT); glEnable(GL_DEPTH_TEST); compText(); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); glGenTextures(1, &texName); glBindTexture(GL_TEXTURE_2D, texName); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_CLAMP); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_CLAMP); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 32, 32, 0, GL_RGBA, GL_UNSIGNED_BYTE, texArray); } void window() { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glEnable(GL_TEXTURE_2D); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL); glBegin(GL_QUADS); glTexCoord3f(10.0, 10.0, 0.0); glVertex3f(10.0, 10.0, 0.0); glTexCoord3f(11.0, 10.0, 0.0); glVertex3f(42.0, 10.0, 0.0); glTexCoord3f(11.0, 11.0, 0.0); glVertex3f(42.0, 42.0, 0.0); glTexCoord3f(10.0, 11.0, 0.0); glVertex3f(10.0, 42.0, 0.0); glEnd(); glFlush(); glDisable(GL_TEXTURE_2D); } This is pretty simple, obviously, and I've copied almost exactly from an example in a book, just to get a feel for the functions. compText() just initializes texArray (my texture) to all red pixels, i.e. texArray is a GLubyte array [32][32][4]. I know the glBindTexture isnt really doing anything with texArray but it's not the problem, as far as I checked. Oh and the window is 400x400 so the square is 32x32 hovering over the bottom left corner, but it shows up as just white. I originally copied a function from a book which was supposed to make the texture a simple grayscale checkerboard, but after these results I just made it red, with still the same results. Anyone spot a problem? Thanks in advance