Class OptimizedScreenSurfaceRenderer
Draws a IScreenSurface with tint. Doesn't allow render steps.
Inherited Members
Namespace: SadConsole.Renderers
Assembly: SadConsole.Host.MonoGame.dll
Syntax
public sealed class OptimizedScreenSurfaceRenderer : IRenderer, IDisposable, IRendererMonoGame
Remarks
This renderer caches the entire drawing of the surface's cells, including the tint of the object.
Constructors
OptimizedScreenSurfaceRenderer()
Creates a new instance of this renderer with the default steps.
Declaration
public OptimizedScreenSurfaceRenderer()
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 |
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; }
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 |
Methods
Dispose()
Declaration
public void Dispose()
~OptimizedScreenSurfaceRenderer()
Disposes the object.
Declaration
protected ~OptimizedScreenSurfaceRenderer()
Refresh(IScreenSurface, bool)
Refreshes a cached drawing state.
Declaration
public 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 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 |