Are TImages loaded into VRAM or system memory?

BlitzMax Forums/BlitzMax Programming/Are TImages loaded into VRAM or system memory?

Russell(Posted 2009) [#1]
From what I understand, []i]pixmaps[/i] are loaded into system memory until drawn/blitted to the video card (screen). Are TImages handled the same way or are they stored in video memory?

On another note, I noticed that TImage has three fields labeled 'mask_r,mask_g and mask_b' so I thought I would be able to change the mask color 'on the fly' by altering these values. Doesn't seem to do anything, though... (Could be used for some interesting effects!).

Russell


_Skully(Posted 2009) [#2]
Think of a TImage as the reference to both the system memory pixelmap and the VRAM texture (2D is done using 3D quads)


plash(Posted 2009) [#3]
Are TImages handled the same way or are they stored in video memory?
The pixmap for an image automagically gets stuffed into vram before it's drawn, afaik, and is always used instead of blitting the pixmap.

On another note, I noticed that TImage has three fields labeled 'mask_r,mask_g and mask_b' so I thought I would be able to change the mask color 'on the fly' by altering these values. Doesn't seem to do anything, though... (Could be used for some interesting effects!).
The mask is only applied when you set the image's pixmap.


Brucey(Posted 2009) [#4]
On another note, I noticed that TImage has three fields...


While you were rummaging around in there, you may have noticed a frames array and pixmap array. When you LoadImage(), it actually loads the data as a Pixmap and stores that pixmap in the TImage type.
Before your TImage is used for the first time, the pixmap data is copied into a texture on the graphics card.

The nice thing with BlitzMax is that all the code for this is included. It's nice to have a look around and learn what goes on down there - and even to find ways of making things work better :-)