Asynchronous loading of fonts, textures, sound files

Return to General Discussion

Asynchronous loading of fonts, textures, sound files

Postby Nemesis#13 » Fri Feb 24, 2012 10:32 am

Hi,
I know PandaLoader can load models asynchronously and with a few settings textures can be made load all in background, too.

But how about loading textures asynchronously explicit?
And how about fonts and sounds? I couldn't find anything about that in the manual or in the API reference.
User avatar
Nemesis#13
 
Posts: 1041
Joined: Mon Aug 04, 2008 8:09 pm
Location: Germany

Postby Nemesis#13 » Mon Feb 27, 2012 4:53 pm

bump
User avatar
Nemesis#13
 
Posts: 1041
Joined: Mon Aug 04, 2008 8:09 pm
Location: Germany

Postby drwr » Tue Apr 24, 2012 4:45 pm

The best way to load textures robustly is to put them in an egg file (for instance with egg-texture-cards) and then load the egg file and extract the textures from it. I recommend this approach because it allows you to specify texture attributes such as mipmaps and texture modes, which you otherwise have to clumsily specify in code if you use just loadTexture(). It also allows you to use the easy callback approach to background loading.

Fonts and sounds don't work the same way, but you can load these in a sub-thread that you create yourself if you really need them to be background loaded.

David
drwr
 
Posts: 11425
Joined: Fri Feb 13, 2004 12:42 pm
Location: Glendale, CA

Postby Nemesis#13 » Fri Apr 27, 2012 8:02 pm

Thanks!
User avatar
Nemesis#13
 
Posts: 1041
Joined: Mon Aug 04, 2008 8:09 pm
Location: Germany


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron