27 using SiliconStudio.Core.Serialization.Converters;
28 using SiliconStudio.Paradox.Games;
29 using SiliconStudio.Core;
31 namespace SiliconStudio.
Paradox.Graphics
36 [
DataConverter(AutoGenerate =
false, ContentReference =
true, DataType =
false)]
76 return New(device, width,
false, format, textureFlags, arraySize, usage);
94 return new Texture1D(device, NewDescription(width, format, textureFlags, mipCount, arraySize, usage));
113 return new Texture1D(device, NewDescription(width,
format, textureFlags, 1, 1, usage),
new[] {GetDataBox(
format, width, 1, 1, textureData, (IntPtr)Interop.Fixed(textureData))});
133 return new Texture1D(device, NewDescription(width, format, textureFlags, 1, 1, usage),
new [] {
new DataBox(dataPtr, 0, 0), });
145 if (image == null)
throw new ArgumentNullException(
"image");
147 throw new ArgumentException(
"Invalid image. Must be 1D",
"image");
149 return new Texture1D(device, CreateTextureDescriptionFromImage(image, textureFlags, usage), image.
ToDataBox());
163 var texture = Texture.Load(device, stream, textureFlags, usage);
165 throw new ArgumentException(
string.Format(
"Texture is not type of [Texture1D] but [{0}]", texture.GetType().Name));
166 return (Texture1D)texture;
174 Dimension = TextureDimension.Texture1D,
178 ArraySize = arraySize,
181 MipLevels = CalculateMipMapCount(mipCount, width),
182 Usage = GetUsageWithFlags(usage, flags),
A simple wrapper to specify number of mipmaps. Set to true to specify all mipmaps or sets an integer ...
_In_ size_t _In_ DXGI_FORMAT _In_ size_t _In_ DXGI_FORMAT _In_ DWORD flags
Provides method to instantiate an image 1D/2D/3D supporting TextureArray and mipmaps on the CPU or to...
Base class for converters to/from a data type.
GraphicsResourceUsage
Identifies expected resource use during rendering. The usage directly reflects whether a resource is ...
ImageDescription Description
Description of this image.
override Texture Clone()
Makes a copy of this texture.
TextureDimension
Defines the dimension of a texture.
Performs primitive-based rendering, creates resources, handles system-level variables, adjusts gamma ramp levels, and creates shaders. See The+GraphicsDevice+class to learn more about the class.
Flags
Enumeration of the new Assimp's flags.
A Common description for all textures.
A Texture 1D frontend to SharpDX.Direct3D11.Texture1D.
static unsafe Texture1D New(GraphicsDevice device, int width, PixelFormat format, IntPtr dataPtr, TextureFlags textureFlags=TextureFlags.ShaderResource, GraphicsResourceUsage usage=GraphicsResourceUsage.Immutable)
Creates a new Texture1D with a single level of mipmap.
DataBox[] ToDataBox()
Gets the databox from this image.
static Texture1D New(GraphicsDevice device, int width, PixelFormat format, TextureFlags textureFlags=TextureFlags.ShaderResource, int arraySize=1, GraphicsResourceUsage usage=GraphicsResourceUsage.Default)
Creates a new Texture1D with a single mipmap.
static Texture1D New(GraphicsDevice device, int width, MipMapCount mipCount, PixelFormat format, TextureFlags textureFlags=TextureFlags.ShaderResource, int arraySize=1, GraphicsResourceUsage usage=GraphicsResourceUsage.Default)
Creates a new Texture1D.
Provides access to data organized in 3D.
_In_ size_t _In_ size_t _In_ DXGI_FORMAT format
static TextureDescription NewDescription(int width, PixelFormat format, TextureFlags flags, int mipCount, int arraySize, GraphicsResourceUsage usage)
static new Texture1D New(GraphicsDevice device, Image image, TextureFlags textureFlags=TextureFlags.ShaderResource, GraphicsResourceUsage usage=GraphicsResourceUsage.Immutable)
Creates a new Texture1D directly from an Image.
PixelFormat
Defines various types of pixel formats.
static new Texture1D Load(GraphicsDevice device, Stream stream, TextureFlags textureFlags=TextureFlags.ShaderResource, GraphicsResourceUsage usage=GraphicsResourceUsage.Immutable)
Loads a 1D texture from a stream.
TextureDimension Dimension
The dimension of a texture.
override Texture ToStaging()
Return an equivalent staging texture CPU read-writable from this instance.
Base class for texture resources.