How to get available video mem?

Started by pjohnsen, February 20, 2007, 17:45:28

Previous topic - Next topic

pjohnsen

Hi,

Is there any way to get the amount of currently available video mem? I would use this for debugging to make sure that I correctly free all buffers and textures.

I expect it would be available through glGetInteger, but can't seem to find a constant that returns available vmem.

I'm currently working on a model viewer, and would like to be sure that I free up everything correctly when closing down one model in order to load in another one.

Any help appreciated,

-Pelle

Fool Running

You should be able to do it in straight Java by doing something like:
    GraphicsEnvironment env;
    GraphicsDevice device;

        env = GraphicsEnvironment.getLocalGraphicsEnvironment();
        device = env.getDefaultScreenDevice();
        System.out.println("Free video memory: " + (device.getAvailableAcceleratedMemory() / 1024)
                    + "Kb\n");


Hope that helps ;D
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D

pjohnsen

Thanks, that was exactly what I needed :)

-Pelle