How to get the videomem?

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

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?

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.

ok thanks

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.

There is: Graphic cards before GF4 / GF5 say it as they will refuse to accept other sizes than square power of 2 textures.

Yes, OpenGL 1.2 by default is specified to have square textures only. It wasn't until later versions that rectangular textures became implemented.

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

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

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