Preloading Meshes and Textures

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
trollger
Posts: 84
Joined: Tue Jun 01, 2010 2:17 am
Location: At my computer

Preloading Meshes and Textures

Post by trollger »

Hi eveyone, I have a potentialy silly questions for you all, but I suppose this is the right place to ask it :)

I am trying to preload all of the resources for my game via a custom ResouuceManager class (images, textures, meshes, fancy loading bar, etc...) and from my reading of the APIs it is my understanding that calling IVideoDriver::getTexture(path) and/or ISceneManager::getMesh(path) will preload a resource. If I make this class reads an XML file of paths to load and I call getTexture, and getMesh respectavly for each resource but dont assign it to a pointer, will the resource be ready to use later, or will I just be loading everything twice? I hope my question made sense.

Thanks for reading.
luthyr
Posts: 69
Joined: Wed Dec 30, 2009 5:47 pm

Re: Preloading Meshes and Textures

Post by luthyr »

Yes, it will load it into the texture/mesh cache and it will be ready to use, though I've sometimes noticed an additional performance hit the first time it is drawn (presumably it's the first time it gets sent to the GPU). Still, it's much faster than loading it later.
trollger
Posts: 84
Joined: Tue Jun 01, 2010 2:17 am
Location: At my computer

Re: Preloading Meshes and Textures

Post by trollger »

Thanks for the confirmation.
Post Reply