allocedmem() for Graphics?
BlitzMax Forums/BlitzMax Programming/allocedmem() for Graphics?
| ||
How can i see how much graphic memory is alloced by my application? Didn't find anything in max2D. |
| ||
You can't at the moment at least not with the standard functionality |
| ||
Yeah but somehow with OpenGL maybe? |
| ||
You could at least try to estimate it. ie 800x600 32-bit display is probably RGBA, so.. 800x600x4 gives you the size in bytes of one buffer x2 for the double buffer? |
| ||
Yes that wouldn't be a problem until i start to load some Images, what i'll do for sure ;) |
| ||
You can calculate the size of a image in RAM ... used_ram = widht * height * screen_depth as there are not compressed textures in Max2D module which would influence this equation |
| ||
Screen depth does not influence images in Max, masked and alpha images take 4 bytes per pixel, others use 3 bytes per pixel of vidmem. There are also 1 byte per pixel formats only used by imagefont glyphs at this time. |
| ||
Save all your images in BMP format. |
| ||
BMP! Big and no alpha channel. PNG should be standard but if not then TGA. |
| ||
I agree. But since it (mostly) isn't compressed, it will give you a good indication of how much memory you will need. Keep in mind that knowing this, is somewhat futile since you have no way of checking whether said ammount of graphics memory actually exists. |
| ||
I agree. But since it (mostly) isn't compressed, it will give you a good indication of how much memory you will need BMP uses RLE (run-time length encoding), which can actually be very efficient for images that use relatively few colors. If you're talking about true-color photo's then yes, BMP is doesn't compress much... but the less actual colors you use, the better the compression gets. BMP filesize is not a good indication on how much actual memory the decompressed image would take up. |
| ||
BMP uses RLE (run-time length encoding), which can actually be very efficient for images that use relatively few colors. Hench the mostly bit. Also BMP does not use Run Length Encoding by default. It can use (as an option) RLE to reduce the size of very large, palletized images. For any 24-bit image that contains no large all black or all white sequential areas however RLE is not going to do much to reduce your filesize. but the less actual colors you use, the better the compression gets. Only if you're using a paletteized image. BMP filesize is not a good indication on how much actual memory the decompressed image would take up. No. But it's better, and easier to understand than "nothing". |