PeppeJ
PeppeJ

Reputation: 643

XNA Content, compile or copy

I'm just wondering what the advantages/disadvantage are of using the Content Compiler versus not using it.

I prefer to not compile files, copy them to the output directory and then load them in using other functions rather than 'XNA's' Content.Load<>() function. So I'm wondering if this my way works just as good or if I should go back to using the 'XNA' way.

When I load stuff I use the other functions, such as Texture2D.FromStream()

Upvotes: 1

Views: 164

Answers (3)

pabdulin
pabdulin

Reputation: 35219

In addition to William's answer (here's useful link), ContentManager will also handle disposing of all resources loaded by it automatically. However if you are using only one ContentManager that will not make difference (since your resources will be deallocated on game termination).

Upvotes: 2

Steve H
Steve H

Reputation: 5519

In addition to the other answers, the content processor also makes your asset into an .xnb file which is a binary form of the file which is smaller (so your game download is quicker by the user and takes up lees room on their hard dive) and by loading an xnb file from the content.Load<>() method, it will load quicker in game.

Upvotes: 2

William
William

Reputation: 772

The content compiler makes your content crossplatform compatible, that is, it'll be usable on both XBox360 and PC and even Mac with MonoGame.

If you're targeting only PC, you can stick with the .FromStream option, though there's no gain from doing so except for your artists being able to swap resources without recompiling.

Upvotes: 2

Related Questions