how to monitor loading progress of media

I have been trying to find a way to show a loading status indicator to show the progress of files being loaded for the beginning of each scene in my game. My first guess was to use graphicsDevice.getAvailableAcceleratedMemory() which returns the number of bytes available in VRAM. I call this first (when no images are loaded yet) and then compare it to subsequent calls. I use a bar graph indicator to show how much memory is currently loaded compared to what will be needed to load the scene.

This is imprecise since each time I load the game, the graphs have erradic behaviour. (because graphicsDevice.getAvailableAcceleratedMemory() is only a snapshot according to the API docs for J2sdk1.4.2.

[711 byte] By [afarmanda] at [2007-9-29 21:02:31]
# 1
Try going to the java API documentation and looking up MediaTracker.I do believe it have some functionality in this areaJust a quick thought.
drslinkya at 2007-7-16 1:14:24 > top of Java-index,Other Topics,Java Game Development...
# 2

i wrote a basic little file tracker program....but when i say basic its so basic its unbelievable, but it works for my progs.

i wrote a function that sounts the number of images that i wish to load, i then start loading the images in and every time an image has loaded i up a counter and repaint the screen and draw a line according to the percentage of the images loaded.....dont know if that helps, as i said it is real basic stuff

ptom98a at 2007-7-16 1:14:24 > top of Java-index,Other Topics,Java Game Development...
# 3
Thank you, I found a basic way like yours (ptom). the only difference is I use the image memory sizes of each file. Every time an image has loaded, I up the counter by this files memory size. ie: LOADED += im.getWidth()*im.getHeight()*3It was my second guess ;)
afarmanda at 2007-7-16 1:14:24 > top of Java-index,Other Topics,Java Game Development...