How to get the videomem?

BlitzMax Forums/BlitzMax Beginners Area/How to get the videomem?

Curtastic(Posted 2005) [#1]
How do I find how much video memory my program is using?

Did I hear that image sizes converted to powers of 2? What if I load an image size 128x256? what about 300x10?


ImaginaryHuman(Posted 2005) [#2]
Images are stored in textures which begin at 64x64 and at present are usually in further powers of 2 such as 128x128, 256x256 etc. The amount of memory they take largely depend on the format of the data, for example RGBA8 should take 4 bytes per pixel.

There is no direct way to find out how much video ram is used because OpenGL handles it behind the scenes.


Curtastic(Posted 2005) [#3]
ok thanks


GW(Posted 2005) [#4]
which begin at 64x64 and at present are usually in further powers of 2 such as 128x128, 256x256 etc.


If that is true then its just an openGL thing.
A texture can be *any* power of 2. (e.x. 16x1024) There is nothing that says the texture must be square.


Dreamora(Posted 2005) [#5]
There is: Graphic cards before GF4 / GF5 say it as they will refuse to accept other sizes than square power of 2 textures.


ImaginaryHuman(Posted 2005) [#6]
Yes, OpenGL 1.2 by default is specified to have square textures only. It wasn't until later versions that rectangular textures became implemented.


Curtastic(Posted 2005) [#7]
allright so... I guess its okay to load all my 1024x16 unique horizonal menu bars? (I am serious)

maybe I should cut all my 257x257 images a bit


Dreamora(Posted 2005) [#8]
No it is not ok.
as mentioned the texture needs to be square for OpenGL 1.2, otherwise it needs to be stretched which makes a lot of quality loose


Difference(Posted 2005) [#9]
No it is not ok.
as mentioned the texture needs to be square for OpenGL 1.2, otherwise it needs to be stretched which makes a lot of quality loose


Wrong. Each dimension needs to be a power of two. Not Square. 512x64 f.ex. is fine.

from http://www.opengl.org/resources/tutorials/sig99/advanced99/notes/node50.html
:
The width, height, and depth of a texture image without a border must be powers of two