I'm a professional game developer from Wakefield, England, working for TickTock Games.
I'm a married father of five and I am also the director and lead programmer of Retroburn Ltd.
Martin 'Bytrix' Caine
Father. C++ Games Programmer. Cyclist. Guitarist.
emailfacebooktwittermessengersteamxboxliveretroburn
Tags
2013 3d alphalabs amazon apple archivirtual asynchronous battlefield bad company 2 ben 10 bepu beta blackmagic design blog blue marble bootcamp borderlands bsp calibration charity charvel childsplay comments competition content tracker counter-strike crash csgo css3 cycling dear esther deferred deus ex develop conference direct x discipline documentation doom 3 bfg dpi dr bott eidos elite force email deliverability eurogamer expo facebook focus fresnel game development game horizon game republic gamedev games gaming geoip girls make games global offensive grid guitar half-life 2 hawken hd7 hobbyist htc humble indie bundle imac indie indie trials indietrials intensity pro ip-countryside iron man 3 jamulus rift jquery kids kinect launch conference left 4 dead live lost mac mac osx manchester manhacks mass effect 2 matrox maya minecraft mirrors edge montreal morrowind movies museum of the microstar music mxo2 mini mysql nausea network networking nokia normal mapping obj oculus rift omnitrix ouya pedal for pounds php physics playstation suite port25 portal portal 2 positron posters powermta project aedra project euler promotion properties proton pulse ps vita ps4 psn racer reddit rendering retroburn game studios reviews rift racer riftracer roadkill roller coaster sdl2 shadow racers sharks shoct skyrifters snds space cadet spam trap star trek steam stencyl storage super stock sd1 fr superhot team fortress 2 tesselating tesselation texture editor thunderbird thunderclap ticktock games tiga track builder track bulder trials tv twitter uk ultimatrix usergroup vequencer video vireio visual assist visual studio vorpx voucher vr vr cinema war thunder warren web willow windows 8 windows 8.1 windows phone 7 workbench wp7 wp7dev xbla xblig xblig network xbox xbox live indie games xna xnaukug xperia play zombies on the holodeck
Archive
Links
Web
XNA
Games
Email Deliverability
Tuesday, December 21st 2010 / XNA

Asynchronous content loading in XNA 4.0

Since I first started using XNA (back around the time when XNA 3.0 was just released) I'd been wanting some way to load content without it stalling the main thread.

The problem is that many of the tutorials written for XNA load content item by item up-front when the game or application loads. While this is happening nothing will refresh on screen and if you're loading and decompressing a lot of files it helps to have an animation or something going on while the content loads.

That's where asynchronous loading comes in to play and being a bit of a noob with C# threading I found a nice little extension simply called XNA Content Tracker.

By creating an instance of the ContentTracker and using that to load your content you can specify whether you want the loaded in the standard way or if you want them to be loaded in a worker thread while your main game loop continues to execute. This extension has been an integral part of my engine and during my recent update to XNA 4.0 I went looking for an updated version (without letting Visual Studio just do the upgrade).

Unfortunately the original XNA 3.1 version does not appear to have been updated to XNA 4.0 however I did find a project on GitHub where someone had upgraded the project and also fixed a few minor bugs, the project can be downloaded here:

https://github.com/dubajj/XNA-Content-Tracker

Many thanks to Roonda and Dubajj for their work on this, without it I would have to delve into threading myself which frankly I don't have the time to do!

If you found this post helpful please leave a comment below:
 
Comments
0