Re: Texture NPOT
Posted by paolofuse on Sep 14, 2015; 12:34pm
URL: https://forum.jogamp.org/Texture-NPOT-tp4035280p4035297.html
I read the documentation.
The documentation says that the Texture class with texture.enable(gl) should call gl.glEnable(GL2. GL_TEXTURE_RECTANGLE_ARB), or I misunderstood?
However if I call manually gl.glEnable(GL2.GL_TEXTURE_RECTANGLE_ARB) it doesn't work. This is the code:
public void display(GLAutoDrawable drawable)
{
GL2 gl = drawable.getGL().getGL2();
gl.glClearColor(1f, 1f, 1f, 1f);
gl.glClear(GL2.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT);
gl.glEnable(GL2.GL_TEXTURE_RECTANGLE_ARB);
gl.glBind(GL2.GL_TEXTURE_RECTANGLE_ARB, texture.getTextureOjbect());
gl.glEnableClientState(GL2.GL_VERTEX_ARRAY);
gl.glBindBuffer(GL2.GL_ARRAY_BUFFER, vexVBO[0]);
gl.glVertexPointer(3, GL2.GL_FLOAT, 0, 0l);
gl.glEnableClientState(GL2.GL_TEXTURE_COORD_ARRAY);
gl.glBindBuffer(GL2.GL_ARRAY_BUFFER, texVBO[0]);
gl.glTexCoordPointer(2, GL2.GL_FLOAT, 0, 0l);
gl.glDrawArrays(GL2.GL_TRIANGLE_FAN, 0, 4);
gl.glDisable(GL2.GL_TEXTURE_RECTANGLE_ARB);
}
The other solution is to use GL_ARB_texture_non_power_of_two, but I cannot find any example about it.