static void CopyTexture( Texture srcTexture, Texture dstTexture )
static void CopyTexture( Texture srcTexture, Texture dstTexture, int srcMipSlice, int srcArraySlice, int srcMipLevels, int dstMipSlice, int dstArraySlice, int dstMipLevels )
static void CopyTexture( Texture srcTexture, Texture dstTexture, int srcMipSlice, int srcArraySlice, int dstMipSlice, int dstArraySlice )

book_4_sparkGenerated
code_blocksInput

Description

The CopyTexture method in the Sandbox.Graphics class is a static method used to copy the contents of one texture to another. This operation is useful when you need to duplicate texture data or transfer it between different textures for rendering purposes.

Usage

To use the CopyTexture method, you need to provide two parameters:

  • srcTexture: The source Texture from which the data will be copied.
  • dstTexture: The destination Texture to which the data will be copied.

Ensure that both textures are compatible in terms of format and size to avoid unexpected behavior.

Example

// Example of using CopyTexture
Texture sourceTexture = new Texture(); // Assume this is initialized and contains data
Texture destinationTexture = new Texture(); // Assume this is initialized and ready to receive data

// Copy the contents of sourceTexture to destinationTexture
Graphics.CopyTexture(sourceTexture, destinationTexture);