access/pointer to an irrlichtdriver-backbuffer ?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
knightoflight
Posts: 199
Joined: Sun Aug 24, 2003 5:47 pm
Location: Germany

access/pointer to an irrlichtdriver-backbuffer ?

Post by knightoflight »

does someone know access to the driver-backbuffer ? Pointer/address ?
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

Not possible yet, sorry. What do you want to do with it? Making a screenshot or manipulating it? For saving screenshots, I've already planned to add a possiblity to do that. :)
knightoflight
Posts: 199
Joined: Sun Aug 24, 2003 5:47 pm
Location: Germany

Post by knightoflight »

there are many things one could do - i personally still thought about merging many textures - after createSurface is not possible (another thread) - i thought about merging textures with draw2DImage on a second irrlichtdevice, but isnt it nice, i can do, but no way to get to them ? Is it allowed to add the featue request for a mergeTexture-function (or is it already planned) ?
Guest

Post by Guest »

Why don't you simply lock a texture? You can access any pixel with that.
knightoflight
Posts: 199
Joined: Sun Aug 24, 2003 5:47 pm
Location: Germany

Post by knightoflight »

Ok, Mr. Guest, that wasnt really this thread, but ok:
yes i can lock a texture and access, for example the fuction below, like Niko suggested in the old forum, but its too slow, we need a fuction, that uses the Blitter-fuctions of directx in the base and its all there in irrlicht

//Merge textures Format R5G5B5, same width, same height, transparent color=0
void mergeTextures(video::ITexture* texture1, video::ITexture* texture2)
{
s16 *p1 = (s16*)texture1->lock();
s16 *p2 = (s16*)texture2->lock();

core::dimension2d<s32> dim;
dim = texture1->getDimension();
s32 pitch = texture1->getPitch()/2;

for (s32 x=0; x<dim.Width; ++x)
for (s32 y=0; y<dim.Height; ++y)
if ((p1[y*pitch + x] & 0x7FFF) !=0)
p2[y*pitch+x]=p1[y*pitch + x];

texture1->unlock();
texture2->unlock();
}
Post Reply