Class RendererCoreBase
Base implementation of IGraphicsRenderer
[DataContract]
public abstract class RendererCoreBase : ComponentBase, IComponent, IReferencable, ICollectorHolder, IGraphicsRendererCore, IDisposable
- Inheritance
-
objectRendererCoreBase
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
RendererCoreBase()
Initializes a new instance of the RendererBase class.
protected RendererCoreBase()
RendererCoreBase(string)
Initializes a new instance of the ComponentBase class.
protected RendererCoreBase(string name)
Parameters
namestringThe name attached to this component
Properties
CPUProfilingKey
public ProfilingKey CPUProfilingKey { get; }
Property Value
Content
Gets the ContentManager.
protected ContentManager Content { get; }
Property Value
- ContentManager
The asset manager.
Context
protected RenderContext Context { get; }
Property Value
EffectSystem
Gets the effect system.
protected EffectSystem EffectSystem { get; }
Property Value
- EffectSystem
The effect system.
Enabled
Gets or sets a value indicating whether this RendererCoreBase is enabled.
[DataMember(-20)]
public virtual bool Enabled { get; set; }
Property Value
- bool
trueif enabled; otherwise,false.
GPUProfilingKey
public ProfilingKey GPUProfilingKey { get; }
Property Value
GraphicsDevice
Gets the graphics device.
protected GraphicsDevice GraphicsDevice { get; }
Property Value
- GraphicsDevice
The graphics device.
Initialized
Gets a value indicating whether this renderer is initialized.
public bool Initialized { get; }
Property Value
Profiling
public bool Profiling { get; set; }
Property Value
Services
Gets the IServiceRegistry.
protected IServiceRegistry Services { get; }
Property Value
- IServiceRegistry
The service registry.
Methods
CheckIsInDrawCore()
Checks that the current execution path is between a PreDraw/PostDraw sequence and throws and exception if not.
protected void CheckIsInDrawCore()
Destroy()
Disposes the object's resources.
protected override void Destroy()
Remarks
Override in a derived class to implement disposal logic specific to it.
This method is automatically called whenever a call to Dispose() (or to Release()) has decreased the internal reference count to zero, meaning no other objects (hopefully) hold a reference to this one and its resources can be safely released.
EnsureContext(RenderContext)
protected void EnsureContext(RenderContext context)
Parameters
contextRenderContext
Initialize(RenderContext)
Loads this renderer. See remarks.
public void Initialize(RenderContext context)
Parameters
contextRenderContextThe context.
Remarks
This method allow a renderer to prepare for rendering. This method should be called once to initialize a renderer.
InitializeCore()
protected virtual void InitializeCore()
NewScopedBuffer(BufferDescription, PixelFormat)
Gets a temporary buffer with the specified description, scoped for the duration of the current draw call.
protected Buffer NewScopedBuffer(BufferDescription description, PixelFormat viewFormat = PixelFormat.None)
Parameters
descriptionBufferDescriptionThe description of the buffer to allocate
viewFormatPixelFormatThe pixel format seen in shader
Returns
- Buffer
The temporary buffer.
- See Also
NewScopedTypedBuffer(int, PixelFormat, bool, GraphicsResourceUsage)
Gets a temporary typed buffer, scoped for the duration of the current draw call.
protected Buffer NewScopedTypedBuffer(int count, PixelFormat viewFormat, bool isUnorderedAccess, GraphicsResourceUsage usage = GraphicsResourceUsage.Default)
Parameters
countintThe number of elements in the buffer.
viewFormatPixelFormatThe pixel format used to view the buffer.
isUnorderedAccessboolWhether the buffer supports unordered access.
usageGraphicsResourceUsageThe intended usage of the buffer.
Returns
- Buffer
The temporary buffer.
- See Also
PostDrawCore(RenderDrawContext)
protected virtual void PostDrawCore(RenderDrawContext context)
Parameters
contextRenderDrawContext
PostDrawCoreInternal(RenderDrawContext)
protected void PostDrawCoreInternal(RenderDrawContext context)
Parameters
contextRenderDrawContext
PreDrawCore(RenderDrawContext)
protected virtual void PreDrawCore(RenderDrawContext context)
Parameters
contextRenderDrawContext
PreDrawCoreInternal(RenderDrawContext)
protected void PreDrawCoreInternal(RenderDrawContext context)
Parameters
contextRenderDrawContext
PushScopedResource<T>(T)
Pushes a new scoped resource to the current Draw.
protected T PushScopedResource<T>(T resource) where T : GraphicsResource
Parameters
resourceTThe scoped resource
Returns
- T
Type Parameters
T
ToLoadAndUnload<T>(T)
protected T ToLoadAndUnload<T>(T effect) where T : class, IGraphicsRendererCore
Parameters
effectT
Returns
- T
Type Parameters
T
Unload()
Unloads this instance on dispose.
protected virtual void Unload()