Class StreamingManager
Performs content streaming.
public class StreamingManager : GameSystemBase, IDisposable, ICollectorHolder, IGameSystemBase, IComponent, IReferencable, IUpdateable, IDrawable, IContentable, IStreamingManager, ITexturesStreamingProvider- Inheritance
- 
      objectStreamingManager
- Implements
- Inherited Members
- Extension Methods
Constructors
StreamingManager(IServiceRegistry)
Initializes a new instance of the StreamingManager class.
public StreamingManager(IServiceRegistry services)Parameters
- servicesIServiceRegistry
- The servicies registry. 
Remarks
The GameSystem expects the following services to be registered: IGame and IContentManager.
Fields
ManagerUpdatesInterval
The interval between StreamingManager updates.
public TimeSpan ManagerUpdatesIntervalField Value
MaxResourcesPerUpdate
The maximum number of resources updated per streaming manager tick. Used to balance performance/streaming speed.
public int MaxResourcesPerUpdateField Value
ResourceLiveTimeout
The StreamableResource live timeout. Resources that aren't used for a while are downscaled in quality.
public TimeSpan ResourceLiveTimeoutField Value
TargetedMemoryBudget
The targeted memory budget of the streaming system in MB. If the memory allocated by streaming system is under this budget it will not try to unload not visible resources.
public int TargetedMemoryBudgetField Value
Properties
AllocatedMemory
Gets the memory currently allocated by streamable resources in MB.
public float AllocatedMemory { get; }Property Value
AllocatedMemoryBytes
Gets the extact memory amount allocated by streamable resources in bytes.
public long AllocatedMemoryBytes { get; }Property Value
ContentStreaming
Gets the content streaming service.
public ContentStreamingService ContentStreaming { get; }Property Value
Resources
List with all registered streamable resources.
public ICollection<StreamableResource> Resources { get; }Property Value
Methods
Destroy()
Disposes of object resources.
protected override void Destroy()Get(Texture)
Gets the StreamingTexture corresponding to the given texture object.
public StreamingTexture Get(Texture obj)Parameters
- objTexture
- The texture object. 
Returns
- StreamingTexture
- Streamable texture, or null if it can't be found. 
Get<T>(object)
Gets the StreamableResource corresponding to the given resource object.
public T Get<T>(object obj) where T : StreamableResourceParameters
- objobject
- The object. 
Returns
- T
- Streamable resource, or null if it can't be found. 
Type Parameters
- T
- The type of the streamable resource. 
RegisterMemoryUsage(long)
Notify the streaming manager of the change memory used by the resources.
public void RegisterMemoryUsage(long memoryUsedChange)Parameters
- memoryUsedChangelong
- The change of memory used in bytes. This value can be positive of negative. 
SetResourceStreamingOptions(Texture, StreamingOptions?)
Set the streaming options for the resources
public void SetResourceStreamingOptions(Texture texture, StreamingOptions? options = null)Parameters
- textureTexture
- The texture. 
- optionsStreamingOptions?
- The streaming options when streaming those resources 
SetResourceStreamingOptions(ParameterCollection, StreamingOptions?)
Set the streaming options for the resources
public void SetResourceStreamingOptions(ParameterCollection parameters, StreamingOptions? options = null)Parameters
- parametersParameterCollection
- The material parameters. 
- optionsStreamingOptions?
- The streaming options when streaming those resources 
SetResourceStreamingOptions(RenderMesh, StreamingOptions?)
Set the streaming options for the resources
public void SetResourceStreamingOptions(RenderMesh renderMesh, StreamingOptions? options = null)Parameters
- renderMeshRenderMesh
- The render mesh. 
- optionsStreamingOptions?
- The streaming options when streaming those resources 
SetStreamingSettings(StreamingSettings)
public void SetStreamingSettings(StreamingSettings streamingSettings)Parameters
- streamingSettingsStreamingSettings
StreamResources(Texture, StreamingOptions?)
Called when texture is submitted to rendering. Registers referenced resources to stream them.
public void StreamResources(Texture texture, StreamingOptions? options = null)Parameters
- textureTexture
- The texture. 
- optionsStreamingOptions?
- The streaming options when streaming those resources 
StreamResources(ParameterCollection, StreamingOptions?)
Called when material parameters are submitted to rendering. Registers referenced resources to stream them.
public void StreamResources(ParameterCollection parameters, StreamingOptions? options = null)Parameters
- parametersParameterCollection
- The material parameters. 
- optionsStreamingOptions?
- The streaming options when streaming those resources 
StreamResources(RenderMesh, StreamingOptions?)
Called when render mesh is submitted to rendering. Registers referenced resources to stream them.
public void StreamResources(RenderMesh renderMesh, StreamingOptions? options = null)Parameters
- renderMeshRenderMesh
- The render mesh. 
- optionsStreamingOptions?
- The streaming options when streaming those resources 
Update(GameTime)
This method is called when this game component is updated.
public override void Update(GameTime gameTime)Parameters
- gameTimeGameTime
- The current timing.