Page 1 of 1

ITexture array?

Posted: Sun Dec 04, 2005 7:11 am
by Fhqwhgads
is it possible to do something like

ITexture *images[255] = 0;

? And have each element in the array be a seperate image?

Posted: Sun Dec 04, 2005 10:21 am
by MasterD
Sure you can!

But you might want to use irr::core::array instead of a pointer array, because the animator for animating textures uses it.

Example from Irrlicht Demo:

Code: Select all

core::array<video::ITexture*> textures;
	for (s32 g=1; g<8; ++g)
	{
		char tmp[64];
		sprintf(tmp, "../../media/portal%d.bmp", g);
		video::ITexture* t = driver->getTexture(tmp);
		textures.push_back(t);
	}
anim = sm->createTextureAnimator(textures, 100);
and then something like node->addAnimator(anim);
if you are after that stuff.