Table of Contents

Class SkiaGraphicsProvider

Namespace
SimulationFramework.SkiaSharp
Assembly
SimulationFramework.SkiaSharp.dll
public sealed class SkiaGraphicsProvider : SkiaGraphicsObject, IGraphicsProvider, ISimulationComponent, IDisposable
Inheritance
SkiaGraphicsProvider
Implements
Inherited Members

Constructors

SkiaGraphicsProvider(ISkiaFrameProvider, GL, GRGlGetProcedureAddressDelegate)

public SkiaGraphicsProvider(ISkiaFrameProvider frameProvider, GL gl, GRGlGetProcedureAddressDelegate getProcAddress)

Parameters

frameProvider ISkiaFrameProvider
gl GL
getProcAddress GRGlGetProcedureAddressDelegate

Properties

DefaultFont

Returns an instance of the default font.

public IFont DefaultFont { get; }

Property Value

IFont

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public override void Dispose()

GetFont(string, FontStyle, int)

public SKFont GetFont(string fontName, FontStyle styles, int size)

Parameters

fontName string
styles FontStyle
size int

Returns

SKFont

GetFrameCanvas()

Gets the canvas for the current frame.

public ICanvas GetFrameCanvas()

Returns

ICanvas

The canvas which draws to the current frame. This object should never be saved, as it may be different every frame.

Initialize(MessageDispatcher)

Initializes the component. This is called once after the component is added to a simulation.

public void Initialize(MessageDispatcher application)

Parameters

application MessageDispatcher

TryCreateTexture(int, int, ReadOnlySpan<Color>, TextureOptions, out ITexture)

Creates a new bitmap with the provided data.

public bool TryCreateTexture(int width, int height, ReadOnlySpan<Color> pixels, TextureOptions options, out ITexture texture)

Parameters

width int
height int
pixels ReadOnlySpan<Color>
options TextureOptions
texture ITexture

Returns

bool

TryLoadFont(ReadOnlySpan<byte>, out IFont)

Loads a font from a font file.

public bool TryLoadFont(ReadOnlySpan<byte> encodedData, out IFont font)

Parameters

encodedData ReadOnlySpan<byte>
font IFont

Returns

bool

TryLoadSystemFont(string, out IFont)

Attempts to load a system font by name.

public bool TryLoadSystemFont(string name, out IFont font)

Parameters

name string
font IFont

Returns

bool

TryLoadTexture(ReadOnlySpan<byte>, TextureOptions, out ITexture)

Loads a bitmap from a image file.

public bool TryLoadTexture(ReadOnlySpan<byte> encodedData, TextureOptions options, out ITexture texture)

Parameters

encodedData ReadOnlySpan<byte>
options TextureOptions
texture ITexture

Returns

bool