Class StreamingManager
Performs content streaming.
public class StreamingManager : GameSystemBase, IDisposable, ICollectorHolder, IGameSystemBase, IComponent, IReferencable, IUpdateable, IDrawable, IContentable, IStreamingManager, ITexturesStreamingProvider
- Inheritance
-
StreamingManager
- Implements
- Inherited Members
- Extension Methods
Constructors
StreamingManager(IServiceRegistry)
Initializes a new instance of the StreamingManager class.
public StreamingManager(IServiceRegistry services)
Parameters
services
IServiceRegistryThe servicies registry.
Remarks
The GameSystem expects the following services to be registered: IGame and IContentManager.
Fields
ManagerUpdatesInterval
The interval between StreamingManager updates.
public TimeSpan ManagerUpdatesInterval
Field Value
MaxResourcesPerUpdate
The maximum number of resources updated per streaming manager tick. Used to balance performance/streaming speed.
public int MaxResourcesPerUpdate
Field Value
ResourceLiveTimeout
The StreamableResource live timeout. Resources that aren't used for a while are downscaled in quality.
public TimeSpan ResourceLiveTimeout
Field 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 TargetedMemoryBudget
Field 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
obj
TextureThe 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 : StreamableResource
Parameters
obj
objectThe 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
memoryUsedChange
longThe 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
texture
TextureThe texture.
options
StreamingOptions?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
parameters
ParameterCollectionThe material parameters.
options
StreamingOptions?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
renderMesh
RenderMeshThe render mesh.
options
StreamingOptions?The streaming options when streaming those resources
SetStreamingSettings(StreamingSettings)
public void SetStreamingSettings(StreamingSettings streamingSettings)
Parameters
streamingSettings
StreamingSettings
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
texture
TextureThe texture.
options
StreamingOptions?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
parameters
ParameterCollectionThe material parameters.
options
StreamingOptions?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
renderMesh
RenderMeshThe render mesh.
options
StreamingOptions?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
gameTime
GameTimeThe current timing.