Hello everyone.
I wnould like to know if there is anyway to set an alpha value to all pixels from an ITexture object?
ITexture alpha
I think...
So...
(make sure you have namespaces turned on in your program header)
Code: Select all
irr::video::ITexture::getAlpha(s16 color);
Code: Select all
ITexture->getAlpha(s16 color);
The harder one
You can set the Alpha-Value directly.
Use the lock(-method on texture to get the Pointer to the Texture-Data (the Image). And if you use 32-Bit as default-Texture creation, you can set the Alpha-Value as a Byte.
example (not tested):
Mike
Use the lock(-method on texture to get the Pointer to the Texture-Data (the Image). And if you use 32-Bit as default-Texture creation, you can set the Alpha-Value as a Byte.
example (not tested):
Code: Select all
unsigned char* pData = texture->lock();
s32 offset = (y*texture->getPitch())+(x*4);
(pData+offset)[3] = newAlphaByte;
texture->unlock()