DrawPixmap question

BlitzMax Forums/BlitzMax Beginners Area/DrawPixmap question

Tachyon(Posted 2005) [#1]
Is it possible to DrawPixmap onto an TImage object? If so, can it be done with LIGHTBLEND and SHADEBLEND effects?

I could also use any variation of this...DrawPixmap onto another Pixmap, or DrawImage onto another Image. The key is I want to stay off the backbuffer and I want to use SHADEBLEND and LIGHTBLEND blending effects.


Dreamora(Posted 2005) [#2]
You can't draw on an image at all.
Pixmaps ignore blend modes, they are draw pixel by pixel to the backbuffer, not as real images.

Pixmap to Pixmap: Use OO programming, then you can use TPixmap.paste function (see brl.pixmap .bmx for interface)

you can't stay of the backbuffer, its the only buffer you can draw too with images.


Tachyon(Posted 2005) [#3]
Okay, how about this: Does anyone have a VERY FAST way to do a low-level GrabPixmap routine from the backbuffer. I can perform the effect I need by drawing what I want to the backbuffer and grabbing it to use later, but the "grab" part slows me WWAAAYYY down. Certainly some coding God has figured a different way to grab the backbuffer quicker. Anyone?


rdodson41(Posted 2005) [#4]
Not sure about your question Tachyon, but on the subject of pixmaps, didn't the pixmap methods WritePixel and ReadPixel used to be used to write and read a pixel directly to and from the screen? As I remember for WritePixel you passed a coordinate and an argb value. But the functions in this form are no where to be found. Is there any way (OpenGL?) to write and read directly to and from the screen?


Dreamora(Posted 2005) [#5]
GrabPixmap isn't that slow. GrabImage is deadly slow as the conversion Pixmap -> Image is the slow part (grabimage uses a grabpixmap with loadimage afterwards)

And no there is no faster way. For fast stuff you use pixmaps which you draw into other pixmaps using .paste () method of Type TPixmap, I think this is the fastest way.

the only other way using of PBuffer extension of pub.glew if you have a card (real GF4 and newer) which supports it.


Tachyon(Posted 2005) [#6]
Hmm...maybe that's it: you said GrabPixmap isn't slow, but the conversion of the Pixmap to an Image is what slows me down. Why is that? Aren't they esscentially the same thing: a rectanglular group of pixels?

Maybe someone needs to come up with a low-level conversion process? Damn...I wish I knew assembly, or at least the inner workings of OpenGL.