Im having some difficulty applying a texture to a quad. I have used :
image3 = ImageIO.read(new BufferedInputStream(this.getClass().getClassLoader().getResourceAsStream ("tilepng.png")));
to import an image and then used :
ImageUtils.texImage2D(gl, image3);
to create a texture.
finaly I used:
gl.glGenTextures(1,textureid);
gl.glBindTexture (GL.GL_TEXTURE_2D, textureid[0]);
to id the texture.
Later I:
gl.glTexEnvf( GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE, GL.GL_MODULATE );
gl.glEnable(GL.GL_TEXTURE_2D);
gl.glBindTexture (GL.GL_TEXTURE_2D, textureid[0]);
gl.glBegin (GL.GL_QUADS);
gl.glTexCoord2f (0.0f, 0.0f);
gl.glVertex2f (0.0f, 0.0f);
gl.glTexCoord2f (32.0f, 0.0f);
gl.glVertex2f (32.0f, 0.0f);
gl.glTexCoord2f (32.0f, 32.0f);
gl.glVertex2f (32.0f, 32.0f);
gl.glTexCoord2f (0.0f, 32.0f);
gl.glVertex2f (0.0f, 32.0f);
gl.glEnd ();
gl.glDisable (GL.GL_TEXTURE_2D);
The quad shows up one the screen but it is white and not with a texture.
Any suggestions?