Table of Contents

Class Texture1D

Namespace
SharpDX.Toolkit.Graphics
Assembly
HelixToolkit.SharpDX.dll

A Texture 1D front end to SharpDX.Direct3D11.Texture1D.

public class Texture1D : Texture1DBase, IComponent, INotifyPropertyChanged, IDisposable, IComparable<Texture>
Inheritance
Texture1D
Implements
Inherited Members

Methods

Clone()

Makes a copy of this texture.

public override Texture Clone()

Returns

Texture

A copy of this texture.

Remarks

This method doesn't copy the content of the texture.

Load(Device, Stream, TextureFlags, ResourceUsage)

Loads a 1D texture from a stream.

public static Texture1D Load(Device device, Stream stream, TextureFlags flags = TextureFlags.ShaderResource, ResourceUsage usage = ResourceUsage.Immutable)

Parameters

device Device

The SharpDX.Direct3D11.Device.

stream Stream

The stream to load the texture from.

flags TextureFlags

Sets the texture flags (for unordered access...etc.)

usage ResourceUsage

Usage of the resource. Default is SharpDX.Direct3D11.ResourceUsage.Immutable

Returns

Texture1D

A texture

Exceptions

ArgumentException

If the texture is not of type 1D

Load(Device, string, TextureFlags, ResourceUsage)

Loads a 1D texture from a stream.

public static Texture1D Load(Device device, string filePath, TextureFlags flags = TextureFlags.ShaderResource, ResourceUsage usage = ResourceUsage.Immutable)

Parameters

device Device

The SharpDX.Direct3D11.Device.

filePath string

The file to load the texture from.

flags TextureFlags

Sets the texture flags (for unordered access...etc.)

usage ResourceUsage

Usage of the resource. Default is SharpDX.Direct3D11.ResourceUsage.Immutable

Returns

Texture1D

A texture

Exceptions

ArgumentException

If the texture is not of type 1D

New(Device, Texture1D)

Creates a new texture from a SharpDX.Direct3D11.Texture1D.

public static Texture1D New(Device device, Texture1D texture)

Parameters

device Device

The SharpDX.Direct3D11.Device.

texture Texture1D

The native texture SharpDX.Direct3D11.Texture1D.

Returns

Texture1D

A new instance of Texture1D class.

New(Device, Texture1DDescription)

Creates a new texture from a SharpDX.Direct3D11.Texture1DDescription.

public static Texture1D New(Device device, Texture1DDescription description)

Parameters

device Device

The SharpDX.Direct3D11.Device.

description Texture1DDescription

The description.

Returns

Texture1D

A new instance of Texture1D class.

New(Device, Image, TextureFlags, ResourceUsage)

Creates a new Texture1D directly from an Image.

public static Texture1D New(Device device, Image image, TextureFlags flags = TextureFlags.ShaderResource, ResourceUsage usage = ResourceUsage.Immutable)

Parameters

device Device

The SharpDX.Direct3D11.Device.

image Image

An image in CPU memory.

flags TextureFlags

Sets the texture flags (for unordered access...etc.)

usage ResourceUsage

The usage.

Returns

Texture1D

A new instance of Texture1D class.

New(Device, int, MipMapCount, PixelFormat, TextureFlags, int, ResourceUsage)

Creates a new Texture1D.

public static Texture1D New(Device device, int width, MipMapCount mipCount, PixelFormat format, TextureFlags flags = TextureFlags.ShaderResource, int arraySize = 1, ResourceUsage usage = ResourceUsage.Default)

Parameters

device Device

The SharpDX.Direct3D11.Device.

width int

The width.

mipCount MipMapCount

Number of mipmaps, set to true to have all mipmaps, set to an int >=1 for a particular mipmap count.

format PixelFormat

Describes the format to use.

flags TextureFlags

Sets the texture flags (for unordered access...etc.)

arraySize int

Size of the texture 2D array, default to 1.

usage ResourceUsage

The usage.

Returns

Texture1D

A new instance of Texture1D class.

New(Device, int, PixelFormat, TextureFlags, int, ResourceUsage)

Creates a new Texture1D with a single mipmap.

public static Texture1D New(Device device, int width, PixelFormat format, TextureFlags flags = TextureFlags.ShaderResource, int arraySize = 1, ResourceUsage usage = ResourceUsage.Default)

Parameters

device Device

The SharpDX.Direct3D11.Device.

width int

The width.

format PixelFormat

Describes the format to use.

flags TextureFlags

Sets the texture flags (for unordered access...etc.)

arraySize int

Size of the texture 2D array, default to 1.

usage ResourceUsage

The usage.

Returns

Texture1D

A new instance of Texture1D class.

New<T>(Device, int, PixelFormat, T[], TextureFlags, ResourceUsage)

Creates a new Texture1D with a single level of mipmap.

public static Texture1D New<T>(Device device, int width, PixelFormat format, T[] textureData, TextureFlags flags = TextureFlags.ShaderResource, ResourceUsage usage = ResourceUsage.Immutable) where T : unmanaged

Parameters

device Device

The SharpDX.Direct3D11.Device.

width int

The width.

format PixelFormat

Describes the format to use.

textureData T[]

Texture data. Size of must be equal to sizeof(Format) * width

flags TextureFlags

Sets the texture flags (for unordered access...etc.)

usage ResourceUsage

The usage.

Returns

Texture1D

A new instance of Texture1D class.

Type Parameters

T

Type of the initial data to upload to the texture

Remarks

The first dimension of mipMapTextures describes the number of array (Texture1D Array), second dimension is the mipmap, the third is the texture data for a particular mipmap.