ITexture* tex = getDriver()->addTexture(dimension2d<u32>(200,200), "somename");
// something like ???????????????????????????
int pixels[4000] = tex->lock();
for (int x = 0; x < 200; x++)
for (int y = 0; y < 200; y++)
{
// manipulate pixels here, but how to access each pixel?
pixels[x*y] = some color
}
tex->unlock();
ITexture* tex = getDriver()->addTexture(dimension2d<u32>(200,200), "somename");
int *pixels= (int*)tex->lock();
for (int x = 0; x < 200; x++)
for (int y = 0; y < 200; y++)
{
pixels[ y*200 +x] = pixel's color in RGBA format (I think)
}
tex->unlock();
Still not correct as you also need to regard pitch (lines can internally be longer than width). Take a look at the implementation of CImage::setPixel (in source/Irrlicht/CImage.cpp). It should probably be done that way.