2022-08-19 15:13:19 +02:00
|
|
|
|
using Quik.Typography;
|
|
|
|
|
|
|
|
|
|
namespace Quik
|
2022-08-03 14:04:40 +02:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// An object which QUIK commands may be issued to.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class QuikContext
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Draw queue.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public QuikDraw Draw { get; } = new QuikDraw();
|
2022-08-04 15:40:58 +02:00
|
|
|
|
|
2022-08-20 11:57:57 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The object responsible for managing textures.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public IQuikTextureManager TextureManager { get; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The object responsible for managing fonts.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public IQuikFontManager FontManager { get; }
|
|
|
|
|
|
2022-08-19 15:13:19 +02:00
|
|
|
|
public QuikStrokeStyle DefaultStroke { get; set; } = new QuikStrokeStyle(new QuikColor(0xaaaaaaff), 4);
|
2022-08-04 15:40:58 +02:00
|
|
|
|
|
|
|
|
|
public QuikFillStyle DefaultFill { get; set; } = new QuikFillStyle()
|
|
|
|
|
{
|
2022-08-19 15:13:19 +02:00
|
|
|
|
Color = new QuikColor(0xeeeeeeff)
|
2022-08-04 15:40:58 +02:00
|
|
|
|
};
|
2022-08-19 15:13:19 +02:00
|
|
|
|
|
|
|
|
|
public QuikFont DefaultFont { get; set; }
|
2022-08-20 11:57:57 +02:00
|
|
|
|
|
|
|
|
|
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();
|
|
|
|
|
}
|
2022-08-03 14:04:40 +02:00
|
|
|
|
}
|
|
|
|
|
}
|