Hello Guest

How to get available video mem?

  • 2 Replies
  • 4789 Views
How to get available video mem?
« on: February 20, 2007, 17:45:28 »
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

Re: How to get available video mem?
« Reply #1 on: February 20, 2007, 21:47:42 »
You should be able to do it in straight Java by doing something like:
Code: [Select]
    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

Re: How to get available video mem?
« Reply #2 on: February 20, 2007, 23:47:50 »
Thanks, that was exactly what I needed :)

 -Pelle