Pages

Monday, 9 January 2012

How XNA 4.0 Custom Content Pipeline works

By following the article Creating a Custom Importer and Processor I think I figured out how the Content Pipeline actually works with custom content. Turns out, I was quite right. Although very simplified, it works like this:

  • A Content Importer reads asset data into the memory
  • A Content Processor processes the data into actual instances. (Still a little unsure about this)
  • A Writer will finally compile the processed data into an .xnb file.
  • A Reader is used to read from those compiled .xnb files, and is automatically called when you call content.Load<ContentType>.
If you got your importer, processor, writer and reader into place. You can just go on onto normal business by loading you newly created content with content.Load<ContentType>.

As a bonus check out this post by Shawn Hargreaves What to extend in the content pipeline a simple cheat sheet which will tell you what to do in certain scenarios.

No comments:

Post a Comment