mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-01-02 11:28:19 -05:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
29 lines
909 B
C#
29 lines
909 B
C#
using Sandbox.Rendering;
|
|
|
|
namespace Sandbox;
|
|
|
|
public sealed partial class CameraComponent : Component, Component.ExecuteInEditor
|
|
{
|
|
CommandList _hudCommandList = new CommandList( "Hud" ) { Flags = CommandList.Flag.Hud };
|
|
|
|
/// <summary>
|
|
/// Allows drawing on the camera. This is drawn before the post processing.
|
|
/// </summary>
|
|
public HudPainter Hud => new HudPainter( _hudCommandList );
|
|
|
|
CommandList _overlayCommandList = new CommandList( "Overlay" ) { Flags = CommandList.Flag.Hud };
|
|
|
|
/// <summary>
|
|
/// Used to draw to the screen. This is drawn on top of everything, so is good for debug overlays etc.
|
|
/// </summary>
|
|
public HudPainter Overlay => new HudPainter( _overlayCommandList );
|
|
|
|
void Component.ISceneStage.Start()
|
|
{
|
|
// Clear the HUD at the start of every frame, so that
|
|
// subsequent Update()'s will give it fresh data.
|
|
_hudCommandList.Reset();
|
|
_overlayCommandList.Reset();
|
|
}
|
|
}
|