Share via


TextureCube Constructor

Creates a new instance of this object.

Syntax

'Declaration
Public Sub New ( _
         graphicsDevice As GraphicsDevice, _
         size As Integer, _
         mipMap As Boolean, _
         format As SurfaceFormat _
)
public TextureCube (
         GraphicsDevice graphicsDevice,
         int size,
         bool mipMap,
         SurfaceFormat format
)
public:
TextureCube(
         GraphicsDevice graphicsDevice,
         int size,
         bool mipMap,
         SurfaceFormat format
)

Parameters

  • graphicsDevice
    Type: GraphicsDevice
    The device.
  • size
    Type: Int32
    The size (in pixels) of the top-level faces of the cube texture. Subsequent levels of each face will be the truncated value of half of the previous level's pixel dimension (independently). Each dimension is clamped to a minimum of 1 pixel.
  • mipMap
    Type: Boolean
    [MarshalAsAttribute(U1)] True to generate a full mipmap chain, false otherwise.
  • format
    Type: SurfaceFormat
    Surface data format.

Exceptions

Exception type Condition
NotSupportedException One or more of the following is true:
  • The profile does not support the requested format.
  • The profile supports a maximum texture size of 2048.
  • The profile requires texture size to be a power of two.

Remarks

To initialize the resource from an existing file, use ContentManager.Load.

Requirements

Namespace: Microsoft.Xna.Framework.Graphics

Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

See Also

Reference

TextureCube Class
TextureCube Members
Microsoft.Xna.Framework.Graphics Namespace

Platforms

Windows Phone