51 lines
1.4 KiB
C#
51 lines
1.4 KiB
C#
using Quik.Typography;
|
|
|
|
namespace Quik
|
|
{
|
|
/// <summary>
|
|
/// An object which QUIK commands may be issued to.
|
|
/// </summary>
|
|
public class QuikContext
|
|
{
|
|
/// <summary>
|
|
/// Draw queue.
|
|
/// </summary>
|
|
public QuikDraw Draw { get; } = new QuikDraw();
|
|
|
|
/// <summary>
|
|
/// The object responsible for managing textures.
|
|
/// </summary>
|
|
public IQuikTextureManager TextureManager { get; }
|
|
|
|
/// <summary>
|
|
/// The object responsible for managing fonts.
|
|
/// </summary>
|
|
public IQuikFontManager FontManager { get; }
|
|
|
|
public QuikStrokeStyle DefaultStroke { get; set; } = new QuikStrokeStyle(new QuikColor(0xaaaaaaff), 4);
|
|
|
|
public QuikFillStyle DefaultFill { get; set; } = new QuikFillStyle()
|
|
{
|
|
Color = new QuikColor(0xeeeeeeff)
|
|
};
|
|
|
|
public QuikFont DefaultFont { get; set; }
|
|
|
|
public QuikContext(IQuikTextureManager textureManager, IQuikFontManager fontManager)
|
|
{
|
|
TextureManager = textureManager;
|
|
FontManager = fontManager;
|
|
TextureManager.Context = FontManager.Context = this;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Clear the context.
|
|
/// </summary>
|
|
public void Clear()
|
|
{
|
|
Draw.Clear();
|
|
TextureManager.Clear();
|
|
FontManager.Clear();
|
|
}
|
|
}
|
|
} |