abstract class Tinman.Engine.Rendering.GraphicsContext

Derived from

Disposable abstract

Extended by

DirectX11Context sealed
DirectX12Context sealed
OpenGLContext sealed
OpenGLESContext sealed

Abstract base class for IGraphicsContext implementations.

These protected fields must be initialized by subclasses in the constructor:

Public / Methods


public static method CheckDebugEnableLogOutput → ()

returns → bool

true if debug log-output shall be enabled,
false if not.

Checks if debug log-output shall be enabled, according to DebugEnableLogOutput.


public static method DecodeScanline → (6)

pixels in : ColorBuffer

The output pixel buffer.

data in : IntPtr

Pointer to the scanline data to decode.

pitch in : int32

The scanline pitch of data in, in bytes.

format in : int32

The data in format:
0 : A8
1 : A8 B8 G8 R8
2 : A8 R8 G8 B8
3 : R8
4 : R32F
5 : R32F G32F
6 : R32F G32F B32F A32F

srgb in : bool

Treat data in values as sRGB compressed?

alpha in : bool

Decode alpha channel?

Decodes a scanline of pixels.

Public / Attributes


public static attribute DebugEnableLogOutput → (int32)

Enable additional debug-level log output?

This switch must be set before TinmanModule.Initialize is called:
< 0 : disable debug-level log output
= 0 : use LowLevel.IsDebug to toggle debug-level log output
> 0 : enable debug-level log output
Defaults to 0.

Protected / Constructors


protected constructor GraphicsContext → (2)

name in : string

The graphics context name (see IGraphicsContext.Name).

isNearAtZero in : bool

The value for IGraphicsContext.IsNearAtZero.

Creates a new instance of GraphicsContext.

The constructor of a concrete IGraphicsContext implementation must call IGraphicsContext.RegisterRenderEffectFactory once, in order to provide the factory for the built-in render effects.

Protected / Methods


protected method AssertBegun → (1)

source in : string

The error source tag.

Asserts that IBeginEnd.Begin has been called.


protected static method ComputeRenderTargetMemoryConsumption → (3)

width in : int32

Width of render target, in pixels.

height in : int32

Height of render target, in pixels.

format in : RenderTargetFormat

The render target format.

returns → int32

The estimated memory consumption.

Computes the estimated memory consumption of a render target.


protected abstract method DoSetViewport → (1)

value in : Box2I

The viewport rectangle.

Sets the viewport rectangle.


protected static method InstanceRange → (4)

buffer in : IGeometryBuffer

The geometry buffer or null.

first in : int32

The first instance to draw.

count in : int32

The number of instances to draw or -1 to draw all remaining instances in buffer in.

zeroIfNonInstanced in : bool

Return RangeI.Zero for non-instanced geometry? Otherwise, a range containing 0 is returned.

returns → RangeI

The resulting instance range.

Computes the instance range for the given geometry buffer.

Protected / Attributes


protected attribute currentRenderTargets → (RenderTargets)

The current set of render targets that has been specified via IGraphicsContext.SetRenderTarget.


protected attribute renderTargetCount → (int32)

The maximum number of simultaneous render targets, in the range [1..4].

This field must be initialized by subclasses during construction.



public static readonly attribute Logger → (ILogger)

The logger object of this class.