Skip to content

KernelAPI reference

Class HeadlessGraphicsDevice

Namespace: MicroEngine.Core
Assembly: MicroEngine.dll
Guide: Game lifecycle and time

A graphics device for tests: textures keep their size and filter but hold no pixels (unless KeepsPixels); creations, uploads and live textures are counted.

C#
public sealed class HeadlessGraphicsDevice : IGraphicsDevice

Inheritance

object ← HeadlessGraphicsDevice

Implements

IGraphicsDevice

Constructors

HeadlessGraphicsDevice()

C#
public HeadlessGraphicsDevice()

Properties

DefaultFilter

The filter of textures created without one: CreateTexture, atlases. The engine sets it from the game settings (TextureFilter, or its presentation’s default sampler) before Game.Load. Glyph pages of a scalable font follow it too unless the font’s options choose a filter.

C#
public TextureFilter DefaultFilter { get; set; }

Property Value

TextureFilter

KeepsPixels

Whether textures keep a copy of their pixels (creations and updates), which a rasterizing HeadlessRenderer needs to draw them. False by default.

C#
public bool KeepsPixels { get; init; }

Property Value

bool

LiveTextures

Number of textures created and not disposed yet.

C#
public int LiveTextures { get; }

Property Value

int

PixelsUploaded

Pixels sent by creations and updates so far.

C#
public long PixelsUploaded { get; }

Property Value

long

TexturesCreated

Number of textures created so far.

C#
public int TexturesCreated { get; }

Property Value

int

Updates

Number of region updates (Update) so far.

C#
public int Updates { get; }

Property Value

int

Methods

CreateTexture(PixelImage)

Uploads image as a texture sampled with DefaultFilter. The caller owns the texture and disposes it.

C#
public Texture CreateTexture(PixelImage image)

Parameters

image PixelImage

Returns

Texture

CreateTexture(PixelImage, TextureFilter)

Uploads image as a texture sampled with filter. The caller owns the texture and disposes it.

C#
public Texture CreateTexture(PixelImage image, TextureFilter filter)

Parameters

image PixelImage

filter TextureFilter

Returns

Texture