Class ScreenSurfaceRenderer
Draws a IScreenSurface.
Inherited Members
Namespace: SadConsole.Renderers
Assembly: SadConsole.Host.MonoGame.dll
Syntax
public class ScreenSurfaceRenderer : IRenderer, IDisposable, IRendererMonoGame
Remarks
This renderer caches the entire drawing of the surface's cells, including the tint of the object.
Constructors
ScreenSurfaceRenderer()
Creates a new instance of this renderer with the default steps.
Declaration
public ScreenSurfaceRenderer()
Fields
_backingTexture
Quick access to backing texture.
Declaration
public RenderTarget2D _backingTexture
Field Value
Type | Description |
---|---|
RenderTarget2D |
_finalDrawColor
Color used with drawing the texture to the screen. Let's a surface become transparent.
Declaration
public Color _finalDrawColor
Field Value
Type | Description |
---|---|
Color |
_renderTexture
The final texture steps are drawing on.
Declaration
protected GameTexture _renderTexture
Field Value
Type | Description |
---|---|
GameTexture |
disposedValue
Detects redundant calls.
Declaration
protected bool disposedValue
Field Value
Type | Description |
---|---|
bool |
Properties
BackingTextureUsageMode
Used when creating the _backingTexture variable.
Declaration
public RenderTargetUsage BackingTextureUsageMode { get; set; }
Property Value
Type | Description |
---|---|
RenderTargetUsage |
CachedRenderRects
Cached set of rectangles used in rendering each cell.
Declaration
public Rectangle[] CachedRenderRects { get; protected set; }
Property Value
Type | Description |
---|---|
Rectangle[] |
IsForced
Declaration
public bool IsForced { get; set; }
Property Value
Type | Description |
---|---|
bool |
MonoGameBlendState
The blend state used by this renderer.
Declaration
public BlendState MonoGameBlendState { get; set; }
Property Value
Type | Description |
---|---|
BlendState |
Name
The name used to create the renderer from the host.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
string |
Opacity
A 0 to 255 value representing how transparent the surface is when it's drawn to the screen. 255 represents full visibility.
Declaration
public byte Opacity { get; set; }
Property Value
Type | Description |
---|---|
byte |
Output
The cached texture of the drawn surface.
Declaration
public ITexture Output { get; }
Property Value
Type | Description |
---|---|
ITexture |
Steps
The render steps for the renderer.
Declaration
public List<IRenderStep> Steps { get; set; }
Property Value
Type | Description |
---|---|
List<IRenderStep> |
Methods
AddDefaultSteps()
Adds the render steps this renderer uses.
Declaration
protected virtual void AddDefaultSteps()
Dispose()
Declaration
public void Dispose()
Dispose(bool)
Release the backing texture and the render texture target.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing | Indicates that the managed resources should be cleaned up. |
~ScreenSurfaceRenderer()
Disposes the object.
Declaration
protected ~ScreenSurfaceRenderer()
Refresh(IScreenSurface, bool)
Refreshes a cached drawing state.
Declaration
public virtual void Refresh(IScreenSurface screen, bool force = false)
Parameters
Type | Name | Description |
---|---|---|
IScreenSurface | screen | |
bool | force | When true, indicates the refresh should happen even if a surface isn't dirty. |
Render(IScreenSurface)
Creates a drawcall in the drawing pipeline.
Declaration
public virtual void Render(IScreenSurface screen)
Parameters
Type | Name | Description |
---|---|---|
IScreenSurface | screen |
Events
BackingTextureRecreated
Raised when the _backingTexture is recreated.
Declaration
public event EventHandler BackingTextureRecreated
Event Type
Type | Description |
---|---|
EventHandler |