Login  Register

Re: Loading texture doesn't work with the correct texture width/height

Posted by WarrenFaith on Jan 27, 2011; 1:39pm
URL: https://forum.jogamp.org/Loading-texture-doesn-t-work-with-the-correct-texture-width-height-tp2362327p2362687.html

When I try it with this:
BufferedImage bufferedImage;
try {
	bufferedImage = ImageIO.read(new URI("http://192.168.0.39/images/test.png").toURL());
	Texture texture = AWTTextureIO.newTexture(gl.getGLProfile(), bufferedImage, true);
	texture.setTexParameteri(GL2ES2.GL_TEXTURE_MAG_FILTER, GL2ES2.GL_LINEAR);
	texture.setTexParameteri(GL2ES2.GL_TEXTURE_MIN_FILTER, GL2ES2.GL_LINEAR_MIPMAP_NEAREST);
	texture.bind();
} catch (Exception e) {
	e.printStackTrace();
}

I get this:

javax.media.opengl.GLException: INT_BGR n.a.
	at com.jogamp.opengl.util.texture.awt.AWTTextureData.createFromImage(AWTTextureData.java:317)
	at com.jogamp.opengl.util.texture.awt.AWTTextureData.<init>(AWTTextureData.java:105)
	at com.jogamp.opengl.util.texture.awt.AWTTextureIO.newTextureDataImpl(AWTTextureIO.java:127)
	at com.jogamp.opengl.util.texture.awt.AWTTextureIO.newTextureData(AWTTextureIO.java:64)
	at com.jogamp.opengl.util.texture.awt.AWTTextureIO.newTexture(AWTTextureIO.java:116)

Ok, so I understand that somehow the colormodel is different, but I have no idea how I can change the color model of my texture image?!