Login  Register

Re: Texture NPOT

Posted by paolofuse on Sep 14, 2015; 10:11am
URL: https://forum.jogamp.org/Texture-NPOT-tp4035280p4035291.html

Ok. Usually I use VBO, FBO and so on, but I want to understand why, with this simple code, taken from the official demo
(https://github.com/sgothel/jogl-demos/blob/master/src/demos/texture/TestTexture.java) I can display only POT texture.

texture.enable(gl);
texture.bind(gl);
gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_TEXTURE_ENV_MODE, GL.GL_REPLACE);
TextureCoords coords = texture.getImageTexCoords();

 gl.glBegin(GL2.GL_QUADS);
 gl.glTexCoord2f(coords.left(), coords.bottom());
 gl.glVertex2f(0, 0);
 gl.glTexCoord2f(coords.right(), coords.bottom());
 gl.glVertex2f(1, 0);
 gl.glTexCoord2f(coords.right(), coords.top());
 gl.glVertex2f(1, 1);
 gl.glTexCoord2f(coords.left(), coords.top());
 gl.glVertex2f(0, 1);
 gl.glEnd();
 texture.disable(gl);

If I want to test a feature I use the simplest code possible. And this from demo is that.