Skip to content

GraphicsAPI reference

Class RenderTarget

Namespace: MicroEngine.Graphics.Devices
Assembly: MicroEngine.Graphics.dll
Guide: The graphics device

A colour attachment (plus optional depth) that passes render to. Offscreen targets come from CreateRenderTarget and can be sampled through Color and read back. The surface target comes from TryAcquireSurfaceTarget, is valid until the next Present, cannot be sampled and cannot be read back.

C#
public abstract class RenderTarget : GraphicsResource, IDisposable

Inheritance

object ← GraphicsResource ← RenderTarget

Implements

IDisposable

Inherited Members

GraphicsResource.Dispose(), GraphicsResource.Release(), GraphicsResource.Expire(), GraphicsResource.MarkLost(), GraphicsResource.Device, GraphicsResource.Name, GraphicsResource.Handle, GraphicsResource.IsDisposed, GraphicsResource.IsLost, GraphicsResource.OwnedBy, object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Constructors

RenderTarget(IGraphicsDevice, in RenderTargetDescription, bool)

Creates the target object.

C#
protected RenderTarget(IGraphicsDevice device, in RenderTargetDescription description, bool isSurface)

Parameters

device IGraphicsDevice

description RenderTargetDescription

isSurface bool

Properties

Bounds

The whole target as a rectangle.

C#
public RectI Bounds { get; }

Property Value

RectI

Color

The colour texture for sampling; null for the surface target. Owned by the target.

C#
public abstract Texture? Color { get; }

Property Value

Texture?

ColorFormat

Colour format: what a pipeline drawing into it must declare.

C#
public TextureFormat ColorFormat { get; }

Property Value

TextureFormat

DepthFormat

Depth format, or null when the target has no depth texture.

C#
public TextureFormat? DepthFormat { get; }

Property Value

TextureFormat?

Description

Size and formats.

C#
public RenderTargetDescription Description { get; }

Property Value

RenderTargetDescription

Height

Height in pixels.

C#
public int Height { get; }

Property Value

int

IsSurface

True for the surface (back buffer) target.

C#
public bool IsSurface { get; }

Property Value

bool

Width

Width in pixels.

C#
public int Width { get; }

Property Value

int