Page 1 of 1

How to copy textures into a texture ?

Posted: Wed Oct 31, 2007 6:08 pm
by khayyam
Hello everybody,

I'm trying to copy a texture into another texture. How should I proceed ?
I'm looking for something like

Code: Select all

video::ITexture *renderTexture(video::ITexture *target, video::ITexture *source, core::rect<int>& position);
I don't really understandthe difference between ITexture and IImage, so the solution may use IImage ...

Posted: Wed Oct 31, 2007 10:00 pm
by vi-wer
You can lock both textures and copy the data from one to the other. You can lock IImage too. So you can copy data from an IImage to an ITexture or vice versa. For more information take a look at the irrlicht API.

I'm not sure about the difference between IImage and ITexture, but I guess an IImage is the image data stored inside system memory while an ITexture is stored inside the vga memory and is resized if the image size is not supported by the vga card (a 320x240 texture will be resized to 512x512 by irrlicht).