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.
public sealed class HeadlessGraphicsDevice : IGraphicsDeviceInheritance
object ← HeadlessGraphicsDevice
Implements
Constructors
HeadlessGraphicsDevice()
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.
public TextureFilter DefaultFilter { get; set; }Property Value
KeepsPixels
Whether textures keep a copy of their pixels (creations and updates), which a rasterizing HeadlessRenderer needs to draw them. False by default.
public bool KeepsPixels { get; init; }Property Value
LiveTextures
Number of textures created and not disposed yet.
public int LiveTextures { get; }Property Value
PixelsUploaded
Pixels sent by creations and updates so far.
public long PixelsUploaded { get; }Property Value
TexturesCreated
Number of textures created so far.
public int TexturesCreated { get; }Property Value
Updates
Number of region updates (Update) so far.
public int Updates { get; }Property Value
Methods
CreateTexture(PixelImage)
Uploads image as a texture sampled with DefaultFilter. The caller owns the texture and disposes it.
public Texture CreateTexture(PixelImage image)Parameters
image PixelImage
Returns
CreateTexture(PixelImage, TextureFilter)
Uploads image as a texture sampled with filter. The caller owns the texture and disposes it.
public Texture CreateTexture(PixelImage image, TextureFilter filter)Parameters
image PixelImage
filter TextureFilter