Annoying pause on texture first use
Posted: Mon Mar 28, 2011 11:04 am
Ok, strange problem which I'm sure I've seen addressed here before, but I can't find the post.
On my game init, when I load in the object/scene data I make sure to call driver->getTexture(filename) each time I come across a required texture, to ensure that it's preloaded and stored on the video card.
However, when the game starts, the first use of any texture (ie: displaying a mesh or quad using it) produces a small but annoying halt in the game. After that, there are no slowdowns, at least until another unused texture is displayed.
It's a particular problem with my particle engine since the first time an explosion is created it's using about 5 previously undisplayed textures. It's not caused by large calls to new or delete as all my objects are pooled.
Any thoughts? Any way I can force getTexture() to actually force a texture load, besides actually displaying that texture on an invisible quad or something?
D
On my game init, when I load in the object/scene data I make sure to call driver->getTexture(filename) each time I come across a required texture, to ensure that it's preloaded and stored on the video card.
However, when the game starts, the first use of any texture (ie: displaying a mesh or quad using it) produces a small but annoying halt in the game. After that, there are no slowdowns, at least until another unused texture is displayed.
It's a particular problem with my particle engine since the first time an explosion is created it's using about 5 previously undisplayed textures. It's not caused by large calls to new or delete as all my objects are pooled.
Any thoughts? Any way I can force getTexture() to actually force a texture load, besides actually displaying that texture on an invisible quad or something?
D