Pixmaps?

BlitzMax Forums/BlitzMax Beginners Area/Pixmaps?

CASO(Posted 2006) [#1]
What is a pixmap? When is it necessary to use them? Can a pixmap be scaled up or down?

I am really confuse on this subject. Can someone please explain it to me?


Dreamora(Posted 2006) [#2]
Pixmap are ram pictures ie bitdata.

They are used if you want to modify the content of a picture dynamically as this is only possible on pixmaps. But they have their drawback compared to images: They draw slower, blend mode and several other state commands don't work and such things.


ImaginaryHuman(Posted 2006) [#3]
search for `pixmap`, there's already been a tonne of answers to this question


xlsior(Posted 2006) [#4]
- An image is stored in the videoram of your video card
- A pixmap is stored in your computer's 'normal' memory
- Pixmaps are much slower to draw since they need to be transferred over the bus from normal ram to video ram first
- A pixmap can be modified, while normal images are static

So... bottom line: use images whereever you can, but if you need to make changes to them you can do so through pixmaps.

(You can convert an image to a pixmap and vice versa as well, if you have different needs at different times)


CASO(Posted 2006) [#5]
Thanks everybody.


Paposo(Posted 2006) [#6]
Hello

xlsior write:
- An image is stored in the videoram of your video card

Are you sure?

The video memory not have capacity for larger number of images.
I make collections of images great than avalilable video memory

Bye,
Paposo


tonyg(Posted 2006) [#7]
There is a texture manager algo (at least in DX there is) that moves least used textures out of VRAM. If you have a large number of images then you might notice slowdown as 'Bmax' swaps them in/out.
Try Vidmemwatch to check out VRAM usage.


ImaginaryHuman(Posted 2006) [#8]
In GL, OpenGL does the handling of texture priorities and swapping stuff, BlitzMax doesn't have any say in the matter.

The whole reason for having pixmaps initially, is that BlitzMax originally was based on OpenGL only and the OpenGL specification requires that the textures be in video ram in order to use them. Since it has features then to move graphics data to and from main memory, it refers to images in main memory as pixmaps (pixel maps). Textures are uploaded from pixmaps to textures and vice versa can be downloaded to a pixmap or the pixmap can be drawn directly to the backbuffer with glDrawPixels(). I think BRL also has other uses for pixmaps such as needing them in order to load in images from disk and for some pixel manipulation in main memory by the cpu.