Skip to content

OptimizedScreenSurfaceRenderer Class

Draws a IScreenSurface with tint. Doesn’t allow render steps.

C#
public sealed class OptimizedScreenSurfaceRenderer : IRenderer, IDisposable, IRendererMonoGame

Inheritance object

Implements IRenderer, IDisposable, IRendererMonoGame

This renderer caches the entire drawing of the surface’s cells, including the tint of the object.

Creates a new instance of this renderer with the default steps.

C#
public OptimizedScreenSurfaceRenderer()

Quick access to backing texture.

C#
public RenderTarget2D _backingTexture

Color used with drawing the texture to the screen. Let’s a surface become transparent.

C#
public Color _finalDrawColor

The name used to create the renderer from the host.

C#
public string Name { get; set; }

The cached texture of the drawn surface.

C#
public ITexture Output { get; }

The blend state used by this renderer.

C#
public BlendState MonoGameBlendState { get; set; }

Used when creating the _backingTexture variable.

C#
public RenderTargetUsage BackingTextureUsageMode { get; set; }

A 0 to 255 value representing how transparent the surface is when it’s drawn to the screen. 255 represents full visibility.

C#
public byte Opacity { get; set; }

true when the renderer is being forced to be redrawn this frame; otherwise false.

C#
public bool IsForced { get; set; }

Cached set of rectangles used in rendering each cell.

C#
public Rectangle[] CachedRenderRects { get; }

Refreshes a cached drawing state.

C#
public void Refresh(IScreenSurface screen, bool force = false)

screen IScreenSurface

force bool
When true, indicates the refresh should happen even if a surface isn’t dirty.

Creates a drawcall in the drawing pipeline.

C#
public void Render(IScreenSurface screen)

screen IScreenSurface

Disposes the object.

C#
protected ~OptimizedScreenSurfaceRenderer()
C#
public void Dispose()

Raised when the _backingTexture is recreated.

C#
public event EventHandler BackingTextureRecreated

EventHandler