Re: Texture NPOT
Posted by paolofuse on Sep 14, 2015; 8:41am
URL: https://forum.jogamp.org/Texture-NPOT-tp4035280p4035287.html
Well, ok, I know this. I just wrote a simple test to show a texture. Using VBO the problem still remains.
To do the code work I must do:
TextureData textureData = TextureIO.newTextureData(gl.getGLProfile(), new File(filename), false, null);
IntBuffer buffer = IntBuffer.allocate(1);
gl.glGenTextures(1, buffer);
int textureID = buffer.get(0);
gl.glBindTexture(GL2.GL_TEXTURE_2D, textureID);
gl.glTexParameteri(GL2.GL_TEXTURE_2D, GL2.GL_TEXTURE_MIN_FILTER, GL2.GL_LINEAR);
gl.glTexParameteri(GL2.GL_TEXTURE_2D, GL2.GL_TEXTURE_MAG_FILTER, GL2.GL_LINEAR);
gl.glTexImage2D(GL2.GL_TEXTURE_2D, 0, textureData.getPixelFormat(), textureData.getWidth(), textureData.getHeight(), 0, GL2.GL_RGBA, textureData.getPixelType(), textureData.getBuffer());
gl.glBindTexture(GL2.GL_TEXTURE_2D, 0);
And then the past code works.
But why I cannot use simply Texture object?