RenderTarget RenderTarget { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The RenderTarget property in the Sandbox.Graphics class allows you to get or set the current render target. When you set this property, it binds the specified render target and adjusts the viewport to match the dimensions of the render target.

Usage

To use the RenderTarget property, simply assign it a RenderTarget object. This will automatically bind the render target and adjust the viewport accordingly. You can also retrieve the current render target by accessing this property.

Example

// Example of setting a render target
RenderTarget myRenderTarget = new RenderTarget();
Graphics.RenderTarget = myRenderTarget;

// Example of getting the current render target
RenderTarget currentRenderTarget = Graphics.RenderTarget;