10internal sealed class RenderContext
13 private static RenderContext? _current;
14 private static long _nextPassId;
16 internal static RenderContext? Current => _current;
18 private readonly RenderContext? _prior;
20 private RenderContext(View view,
long tick, RenderContext? prior)
22 PassId = System.Threading.Interlocked.Increment(ref _nextPassId);
33 ViewEffectOffsetFactor = view.EffectOffsetFactor;
34 ViewEffectOffsetPx = view.EffectOffsetPx;
37 ViewportZoom = (z > 0f) ? z : 1f;
42 internal long PassId {
get; }
43 internal View View {
get; }
44 internal long Tick {
get; }
45 internal System.Drawing.PointF CameraPositionPx {
get; }
46 internal System.Drawing.Rectangle ViewportTargetRectPx {
get; }
47 internal System.Drawing.PointF ViewportScreenOffsetPx {
get; }
48 internal float ViewportZoom {
get; }
49 internal System.Drawing.PointF ViewEffectOffsetFactor {
get; }
50 internal System.Drawing.PointF ViewEffectOffsetPx {
get; }
52 internal static void Push(View view,
long tick)
54 _current =
new RenderContext(view, tick, _current);
57 internal static void Pop()
59 _current = _current?._prior;
PointF PositionPx
Gets or sets the camera's world-space position in pixels, interpreted as the upper-left corner of the...
Camera Camera
Gets the camera that controls the world-space position and following behavior for this view....
Viewport Viewport
Gets the viewport that defines the screen-space rectangle, zoom level, and other rendering parameters...
Rectangle TargetRectPx
Screen-space rectangle (in SCREEN / RenderSurface pixels) where this view is drawn....
PointF ScreenOffsetPx
Optional per-view HUD/safe-area offset in screen pixels.
float Zoom
Zoom factor applied to the world when rendering this view. Values greater than 1 zoom in,...