Limitations to Accelerated Images?

I’ve located an error in my application using different profilers…

It turns out that if I make 100 instances of ball, each sharing the SAME image but drawn on different positions, obviously - Everything works great and i get more than 100 fps which makes me happy;)

However, If I ask each object to load their own image (eventhough its the same path, but that doesn’t matter of course) my fps dives to 5 which should indicate that they are NOT accelerated…

So the question is: how big is the acc. memory and can I control its size or what images that I can store there?

/Markus

it depends on the size of the image, i am not 100% sure but i think sprites greater than 256 x 256 are not accelerated.

which method do u use to load the images ?

remaining memory on graphics card is


GraphicsEnvironment ge;
ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice gd;
gd =  ge.getDefaultScreenDevice();
gd.getAvailableAcceleratedMemory()

on my nvdia card i have 64mb real VRAM free.

All of the sprites will be attempted to get accelerated. Size doesn’t matter.

I, too, think that the app is running out of vram…
You may want to do some video memory management: use Image.flush() to free up some video memory by removing unneeded sprites from vram.

Thanx - but I actually (and I might say that I’m proud of that) found the solution to my problem :slight_smile:

It turned out that I use a lot of differen images while a lot of the examples that I’ve seen only handle one kind of image, eventhough drawn by hundreds of particles. Only using one image works fine in my system as well but sonce a had quite a lot of images, they somehow competed with each other for the VRAM and most images where dropped out from the VRAM…

Therefore I got into VolatileImage and used that instead and by using the contenstLost() and validate() methods, I could quite easily make all my images fit into the VRAM.

I checked the available memory using the code that MGodehardt showed and I only use 5 Mb which was why I thought it bahaived strange before…

Thanx - I must say that I’ve never really given much hope to forums before, but this place has tought me heaps so far and I’m amazed by the knowledge you guys possess!

Again - Thanx!