How much videoram?

BlitzMax Forums/BlitzMax Beginners Area/How much videoram?

ImaginaryHuman(Posted 2005) [#1]
How do I find out how much videoram there is

a) in total
b) currently available
c) available after Graphics has been used to set up a double-buffered screen
d) is used to store a double-buffered screen
e) is needed to store an image of a given size

???????? Thanks


Dreamora(Posted 2005) [#2]
e) imagewidth * imageheigth * colordepth ( colordepth is normally 24 or 32 bits -> 3 byte )


jhague(Posted 2005) [#3]
Except that, barring special extensions, OpenGL requires texture sizes to be powers of two in each dimension. I assume Blitz does the conversion when an image is loaded. So a 130x150 pixel image really contains 256*256 pixels.


ImaginaryHuman(Posted 2005) [#4]
IT would be really useful to have a way to know how much memory is available (videoram at least), so that you can dynamically adjust and put more or less stuff in videoram.


flying willy(Posted 2005) [#5]
Such a command existed in the Blitz3D version. DirectX may have helped here. Perhaps OpenGL has a call to determine this?


ImaginaryHuman(Posted 2005) [#6]
Hmm. I don't think OpenGL would have such a call. It's a rendering library, not a memory management library. It would probably have to be a command added to blitzMax.


jhague(Posted 2005) [#7]
Unfortunately, this information might not be available to Blitz either, if there's no OpenGL call for it.

Note the OpenGL driver automatically takes care of tranferring textures to video RAM as needed and caching textures in video RAM. You don't have any control over how this works.


ImaginaryHuman(Posted 2005) [#8]
But it would be nice to have control over it if I wanted to employ a particular specialized management of resources crafted to my particular situation.


jhague(Posted 2005) [#9]
Well, honestly, you'll never have much control over it. Different versions of Windows can use different amounts of VRAM. Other applications running at the same time can use VRAM. Video memory management is completely up to the driver, so you could get wildly varying memory usage on different machines with the same video cards.

It sounds like what you really want is to program a console, not a PC.


FlameDuck(Posted 2005) [#10]
It sounds like what you really want is to program a console, not a PC.
Alot of that going around...