UI/OMRScopeFeedPanel.cs
using Sandbox;
using Sandbox.UI;
namespace Sandbox.UI;
/// <summary>
/// Draws a runtime render-target texture directly with Painter.
///
/// This intentionally avoids mutating an <img> panel after Razor rebuilds.
/// Runtime render targets update on the GPU while this panel simply samples the
/// same Texture every frame.
/// </summary>
public sealed class OMRScopeFeedPanel : Panel
{
public Texture SourceTexture { get; set; }
public override void OnDraw( Painter painter )
{
Texture texture = SourceTexture;
if ( texture is null || !texture.IsValid )
return;
painter.Texture(
texture,
painter.Bounds,
Color.White
);
}
}