ITexture* texture = driver->getTexture("../../media/irrlichtlogoalpha.tga");
env->addImage(texture,core::position2d<s32>(10,10));
Is it possible to change the size of an image using Irrlicht. That is, instead of just displaying the loaded image, you can actually stretch the image so its larger.
I noticed you could lock the texture, and get the pixels...what sort of structure would i use to get the data so i could modify it ?
2d graphics - can they be scaled ?
I'm accessing the texture data in my new fire scene node, you can have a look at it, but basicaly you just have to do this:
Of course, this just works, when you have the A8R8G8B8 format, but the others should be similar.
Code: Select all
u8* pixels = (u8*) texture->lock();
for (u32 i = 0; i < pixelNum; i++){
pixels[i * 4] .. //do whatever with the blue component
pixels[i * 4 + 1] .. //green component
pixels[i * 4 + 2] .. //red component
//[i * 4 + 3] could be the alpha value, but I haven't tried it
}