Skip to content

GraphicsAPI reference

Class DeviceGraphics

Namespace: MicroEngine.Graphics
Assembly: MicroEngine.dll
Guide: Graphics

The textures of the drawing API (IGraphicsDevice) made on a graphics device of the device contract: each texture is a device texture whose straight-alpha pixels are premultiplied when they are uploaded, and its Filter chooses the sampler it is drawn with. Backends built on a device use it as their Graphics.

C#
public sealed class DeviceGraphics : IGraphicsDevice

Inheritance

object ← DeviceGraphics

Implements

IGraphicsDevice

Constructors

DeviceGraphics(IGraphicsDevice)

Makes textures on device.

C#
public DeviceGraphics(IGraphicsDevice device)

Parameters

device IGraphicsDevice

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

Device

The device the textures live on.

C#
public IGraphicsDevice Device { get; }

Property Value

IGraphicsDevice

LiveTextures

Textures created and not disposed yet.

C#
public int LiveTextures { get; }

Property Value

int

Methods

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

DisposeAll()

Disposes every texture not disposed yet (the platform is closing).

C#
public void DisposeAll()