Pixmaps

BlitzMax Forums/BlitzMax Beginners Area/Pixmaps

Yahfree(Posted 2008) [#1]
Can anyone explain how they work and how they differ from TImage?

I've only used TImages, however, getting into opengl it seems like to create a texture, Pixmaps are the easyest... Yet I'm having trouble trying to render a image:



I'm getting some wierd errors trying to load the pixmap. Am I doing it right?


tonyg(Posted 2008) [#2]
A pixmap is an area of system memory which describes the colour and alpha of each pixel in the image.
To draw a pixmap requires the data to be copied from system memory into video memory as a surface each time which is not quick.
When you load an image file it still creates a pixmap. However, when you drawimage the pixmap data is copied to a surface, displayed and the surface kept in video memory. The next time you drawimage it reuses that surface which saves the time to copy from system to video memory.
The downside is you cannot directly changes the pixels of an image.
This is done within the pixmap.
<edit>
As for your code, I am not sure what you're trying to do or why but this works (sort of)...



Yahfree(Posted 2008) [#3]
cool, thanks!