DPSF by Daniel Schroeder

<PackageReference Include="DPSF" Version="2.5.0" />

.NET API 168,448 bytes

 DPSFDefaultSettings

public static class DPSFDefaultSettings
Static class used to apply default settings to all DPSF particle systems and particle system managers when they are initialized.

Note: These settings are applied during particle system initialization, and may be overwritten by particle system manager settings.

Gets / Sets the default particle system memory management settings.

public static bool PerformanceProfilingIsEnabled { get; set; }

Gets / Sets if particle system performance timings are Enabled by default or not. Performance profiling is not available on the Reach profile.

public static bool ThrowDebugWarningExceptions { get; set; }

Get and set if DPSF Debug Warning Exceptions should be thrown or not.

These exceptions are typically thrown as a warning to the user that they do not have DPSF configured ideally.

This will only return true (default) if we are running in Debug mode (i.e. the DEBUG compilation symbol is defined) and a debugger is attached. This is done to prevent these exceptions from being thrown when software compiled in Debug mode is released.

public static int UpdatesPerSecond { get; set; }

Gets / Sets the default particle system updates per second.

NOTE: Zero means update as often as possible.

public static bool UseSharedEffectForAllParticleSystems { get; set; }

Gets / Sets if a common BasicEffect and AlphaTestEffect should be used for all particle systems, rather than each particle system creating their own.

NOTE: Using a shared effect will decrease the time it takes to Initialize() each particle system.

NOTE: If using a shared Effect for all particle systems, if one particle system sets an Effect parameter, all other particle systems should also set that same parameter in their overridden SetEffectParameters() function so that each particle system guarantees that the Effect is using the parameters it expects it to be using. For example, if particle system 1 sets the Effect's Texture, that same Texture will be used for particle system 2 unless particle system 2 specifies the new Texture to use.

NOTE: The Graphics Device of the first particle system to be initialized will be used when creating the shared Effect. If you later require a different Graphics Device to be used, you must call the SetGraphicsDeviceForSharedEffectsForAllParticleSystems() function.

public static void ResetToDefaults()

Resets all of the DPSFDefaultSettings' properties to their default values.

public static void SetGraphicsDeviceForSharedEffectsForAllParticleSystems(GraphicsDevice graphicsDevice)

Reinitializes the shared BasicEffect and AlphaTestEffect using the GraphicsDevice provided.

NOTE: If you are using a Shared Effect For All Particle Systems and you change GraphicsDevices, you will need to call this function with the new Graphics Device.