LWJGL Forum
Archive => DevIL => Topic started by: DanDanger on March 24, 2005, 22:25:33
-
Hello all!
Just adding to the pool of knowledge:
Has anyone used IL.ilLoadFromStream() ? I was tryng to use it and thought it was crashing but it turns out it was taking about 30 secs to load my image from a jar file.
I now use this code , which runs fine, instead :
InputStream is = new BufferedInputStream( getClass().getResourceAsStream(path));
ByteBuffer bb = ByteBuffer.allocateDirect(is.available()).order(ByteOrder.nativeOrder());
byte[] ba = new byte[(int)is.available()];
is.read(ba);
bb.put(ba);
bb.clear();
IL.ilLoadL(IL.IL_TGA,bb,is.available());
IL.ilLoadFromStream()
is.close();
-
the current implementation is rather unoptimized. I am working on making devil load dynamically and will optimize the method while I am at it.
-
fixed in CVS. Loads in a splitsecond now :)
-
yeah!
Ill have to get that from CVS, as soon as I figure out how to use cvs :)
-
0.96 includes that fix