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
ISkiaFrameProvidergl
GLgetProcAddress
GRGlGetProcedureAddressDelegate
Properties
DefaultFont
Returns an instance of the default font.
public IFont DefaultFont { get; }
Property Value
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
Returns
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
intheight
intpixels
ReadOnlySpan<Color>options
TextureOptionstexture
ITexture
Returns
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
TryLoadSystemFont(string, out IFont)
Attempts to load a system font by name.
public bool TryLoadSystemFont(string name, out IFont font)
Parameters
Returns
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
TextureOptionstexture
ITexture