JOGL PNG "bug"?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

JOGL PNG "bug"?

Niya
Hi all,

I'm trying to load a PNG image as texture data (because it wasn't working directly creating it from the stream with TextureIO.newTexture())

Code:
    final TextureData td = TextureIO.newTextureData(RPGPlusCanvas.getGlAutoDrawable().getGLProfile(), getClass().getResource("/assets/images/8tiles_75/City_Road_Thru_4x4_NE.png"), GL2.GL_RGBA, GL2.GL_UNSIGNED_BYTE, false, TextureIO.PNG);
    mTest = TextureIO.newTexture(td);

This leads to an exception being thrown:
javax.media.opengl.GLException: format 0x1404 not supported [yet], pls notify the maintainer in case this is our bug.

And so I'm not sure if this is something I'm doing wrong, or how to fix it.
Reply | Threaded
Open this post in threaded view
|

Re: JOGL PNG "bug"?

gouessej
Administrator
Hi

It should work with TextureIO.newTexture(); if it doesn't, it's a bug. I think that the PNG decoder does not support a particular format, 0x1404 matches with INT data type (there are 9 data type formats). You can use javax.imageio.ImageIO (to create a BufferedImage) and AWTTextureData to work around this limitation.
Julien Gouesse | Personal blog | Website