ITexture array?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Fhqwhgads
Posts: 42
Joined: Tue Jun 21, 2005 1:43 am

ITexture array?

Post by Fhqwhgads »

is it possible to do something like

ITexture *images[255] = 0;

? And have each element in the array be a seperate image?
MasterD
Posts: 153
Joined: Sun Feb 15, 2004 4:17 pm
Location: Lübeck, Germany
Contact:

Post 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.
YASS - Yet another Space Shooter
under Devolpment, see http://yass-engine.de
Post Reply