Texture Mapping Not Working

I tried getting around my ByteBuffer-induced OutOfMemoryError by skipping the whole process, using instead the code line-for-line from
www.gamedev.net/reference/articles/article947.asp
.
But it just doesn’t work… the polygons I make are untextured. Now, I am a newbie at openGL, so forgive me if I left out a line that gamedev assumed I would already have, but why doesn’t it work?

I’ve been bashing my head over the same problem. I’m not sure if it is a driver bug or not. The same code in C works correctly, but in Java, it doesn’t work. However, with a display list it works fine. I think there may be something wrong with glBindTexture() call not passing through the TextureID correctly. If you do the following, it’s working correctly on my ATI video card. Don’t have another card to test this out on currently.

int list_id = gl.glGenLists(1);
gl.glNewList(list_id, GL.COMPILE_AND_EXECUTE);
gl.glTexParameteri( … );
gl.glTexImage2D(…)
gl.glEndList();

gl.glCallList(list_id);

Well I finally tracked down my problem - someone had included an extra glBindtexture() call about 5 classes away from where the textures were being generated ??? Fixed that for us.

Also, another thing I forgot is that you may have not included glEnable(GL_TEXTURE_2D) at the start of your render loop.