Dean Iverson wrote:
>
> In our application we load multiple VRML files to place in our 3D editor.
> Most of the textures in these files are the same. I looked at the VRML
> source and traced the texture loading back to a Toolkit.getImage() call.
> Does anybody know if this call will keep track of which textures have been
> loaded by the application?
Toolkit does not do any caching of the images. If you request two copies
of the same image (eg by URL) it will fetch and create new instances
each time. You need to implement your own caching scheme. I suggest you
make heavy use of weak references when you do this in order to avoid
blowing out memory usage.
> More importantly, are textures reused if they
> were loaded by a previous VrmlLoader.load() call?
Can't answer this. My, now faulty, memory suggests that it didn't. If it
did, it was not kept between successive calls to load() or multiple
instances (for example inlined geometry didn't use the same instance).
However, I will stand corrected if that is not the case.
--
Justin Couch Author, Java Hacker
Snr Software Engineer [EMAIL PROTECTED]
ADI Ltd, Systems Group http://www.vlc.com.au/~justin/
New Java3D FAQ Home!!!: http://www.j3d.org/faq/
-------------------------------------------------------------------
"Look through the lens, and the light breaks down into many lights.
Turn it or move it, and a new set of arrangements appears... is it
a single light or many lights, lights that one must know how to
distinguish, recognise and appreciate? Is it one light with many
frames or one frame for many lights?" -Subcomandante Marcos
-------------------------------------------------------------------
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".