ClearFlags ClearFlags { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The ClearFlags property of the CameraComponent class specifies the clear flags for the camera. Clear flags determine how the camera clears the screen before rendering a new frame. This can include clearing the color buffer, depth buffer, or both, depending on the selected flag.

Usage

To use the ClearFlags property, you can set it to one of the values defined in the Sandbox.ClearFlags enumeration. This will dictate how the camera clears the screen before rendering.

Example

// Example of setting the ClearFlags property
CameraComponent camera = new CameraComponent();
camera.ClearFlags = ClearFlags.SolidColor; // Clears the screen with a solid color

// Other possible values include:
// ClearFlags.DepthOnly - Clears only the depth buffer
// ClearFlags.Nothing - Does not clear the screen