Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/Forme.MonoGame/FormeRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,18 @@ public sealed class FormeRenderer : IDisposable
/// </remarks>
public bool IsDisposed { get; private set; }

/// <summary>
/// Gets or sets the <see cref="Microsoft.Xna.Framework.Graphics.RasterizerState"/> applied
/// during the glyph flush in <see cref="End"/>.
/// </summary>
/// <remarks>
/// Defaults to <see cref="RasterizerState.CullNone"/> (no face culling, scissor test
/// disabled). Set this to a state with <c>ScissorTestEnable = true</c> when the caller
/// manages a scissor rect for clipping (e.g. a UI renderer with panel or window clip regions).
/// The value must not be <see langword="null"/>.
/// </remarks>
public RasterizerState RasterizerState { get; set; } = RasterizerState.CullNone;

/// <summary>
/// Initializes a new <see cref="FormeRenderer"/> and loads the embedded Slug shader.
/// </summary>
Expand Down Expand Up @@ -317,7 +329,7 @@ public void End()

_graphicsDevice.BlendState = BlendState.AlphaBlend;
_graphicsDevice.DepthStencilState = DepthStencilState.None;
_graphicsDevice.RasterizerState = RasterizerState.CullNone;
_graphicsDevice.RasterizerState = RasterizerState;
_graphicsDevice.SamplerStates[0] = SamplerState.PointClamp;
_graphicsDevice.SamplerStates[1] = SamplerState.PointClamp;
_graphicsDevice.SamplerStates[2] = SamplerState.PointClamp;
Expand Down
Loading