TextureIO on Android - No suitable reader for given stream when loading standard formats
Posted by Peter F on Aug 13, 2014; 1:42pm
URL: https://forum.jogamp.org/TextureIO-on-Android-No-suitable-reader-for-given-stream-when-loading-standard-formats-tp4032781.html
Hello,
I'm updating our android section of our code base to use JOGL with Android with the help of NEWT.
I'm having trouble with TextureIO when running on Android devices - when so far on platforms such as AWT things run fine.
I'm calling:
InputStream stream = assetManager.open( filePath );
System.out.println( "stream = " + stream );
TextureData data = TextureIO.newTextureData( GLContext.gl().getGLProfile(), stream, false, suffix );
Where the GL Profile is GL2ES2 & the suffix is .png
My logcat shows:
( 3694): stream = android.content.res.AssetManager$AssetInputStream@410773a0
( 3694):
( 3694): java.io.IOException: No suitable reader for given stream
( 3694): at com.jogamp.opengl.util.texture.TextureIO.newTextureDataImpl(TextureIO.java:852)
( 3694): at com.jogamp.opengl.util.texture.TextureIO.newTextureData(TextureIO.java:246)
I'm using the JOGL Android native dependencies in my Android specific project - replacing the standard ones elsewhere.
The file exists & the stream is created for it successfully so far as I can tell.
It looks as though TextureIO is having trouble with the AssetInputStream Android object itself? Am I even going about this correctly? I haven't been able to find an example of loading a texture on android using JOGL.
Any help much appreciated!