Integrating DPSF Into Your XNA Project

Top  Previous  Next

DPSF is packaged as a dll (dynamic link library) that you must add as a reference into your project.  The first thing to do is decide if you want your particle systems to inherit from the Microsoft.XNA.Framework.DrawableGameComponent class or not, as this will affect which dll file you want to import.


In Visual Studio 2008, you can then add a reference to the dll file by clicking on the Project menu item and selecting Add Reference (or by right-clicking on References in the Solution Explorer and choosing Add Reference...).


AddReference   OR   AddReference2


From here you need to select the Browse tab and navigate to the DPSF.dll or DPSFAsDrawableGameComponent.dll file (for Xbox 360 projects use their equivalents DPSFXbox360.dll and DPSFXbox360AsDrawableGameComponent.dll, or the Windows Phone equivalents DPSFPhone.dll and DPSFPhoneDrawableGameComponent.dll) and select OK (you should only reference one of these dll files in your project).  The default location of these dll files is "C:\DPSF".




Once this is done DPSF should show up in your project's References.




You should then be able to access all of the classes and functions in the DPSF namespace by typing DPSF.ClassName, allowing you to create new DPSF particle systems.




To avoid having to put DPSF. in front of all of the DPSF classes and functions, you may put using DPSF; at the top of the file with the rest of the using statements.