GraphicsContext

Description

abstract class Tinman.Engine.Rendering.GraphicsContext

Derived from

Disposable abstract
IGraphicsContext

Extended by

DirectX11Context sealed
DirectX12Context sealed
DirectX9Context sealed
GLContext abstract

Abstract base class for IGraphicsContext implementations.

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

Usually, subclasses will issue render command using a native API, which will be processed by the GPU asynchronously. The following method calls are recommended as implicit events at which to flush the render command buffer:

Public / Constants

Swap​Chain​Format


The render target format flags that are used for swap chains.

Public / Methods

Check​Debug​Enable​Log​Output


[Pure]
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.

Decode​Scanline


public static method DecodeScanline → (6)

pixels in : ColorBuffer

[not-null]
The output pixel buffer.

data in : IntPtr

Pointer to the scanline data to decode.

pitch in : int32

[>0]
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
7 : R16
8 : R16 G16 B16 A16
9 : R16F
10 : R16F G16F
11 : R16F G16F B16F A16F

srgb in : bool

Treat data in values as sRGB compressed?

alpha in : bool

Decode alpha channel?

Decodes a scanline of pixels.

Public / Attributes

Debug​Enable​Log​Output


[DebugHelper] [ShutdownClear]
public static attribute DebugEnableLogOutput → (int32)

Enable additional debug-level log output from the underlying graphics API?

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

Graphics​Context


protected constructor GraphicsContext → (1)

name in : string

[not-empty]
The graphics context name (see IGraphicsContext.Name).

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

Assert​Begun


protected method AssertBegun → (1)

source in : string

The error source tag.

Asserts that IBeginEnd.Begin has been called.

Do​Set​Clip


protected abstract method DoSetClip → (1)

value in : Box2I

The clip rectangle.

Sets the clip rectangle.

Do​Set​Viewport


protected abstract method DoSetViewport → (1)

value in : Box2I

The viewport rectangle.

Sets the viewport rectangle.

Do​Validate​Render​Target​Format


protected abstract method DoValidateRenderTargetFormat → (1)

format in : RenderTargetFormat

The render target format.

returns → bool

The validation result.

Validates the given render target format.

Protected / Attributes

current​Render​Targets


protected attribute currentRenderTargets → (RenderTargets)

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

render​Target​Count


protected attribute renderTargetCount → (int32)

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

This field must be initialized by subclasses during construction.

Logging

Logger


public static readonly attribute Logger → (ILogger)

The logger object of this class.