3 #if SILICONSTUDIO_PARADOX_GRAPHICS_API_DIRECT3D
27 namespace SiliconStudio.
Paradox.Graphics
40 protected internal Texture2D(GraphicsDevice device, TextureDescription description2D, DataBox[] dataBoxes = null) : base(device, description2D, dataBoxes)
54 : base(device, texture, viewType, arraySlice, mipMapSlice, viewFormat)
63 protected internal Texture2D(GraphicsDevice device, SharpDX.Direct3D11.Texture2D texture)
64 : base(device, texture)
68 public override Texture ToTexture(
ViewType viewType,
int arraySlice,
int mipMapSlice)
70 return new Texture2D(GraphicsDevice,
this, viewType, arraySlice, mipMapSlice);
78 public DepthStencilBuffer ToDepthStencilBuffer(
bool isReadOnly)
80 return new DepthStencilBuffer(GraphicsDevice,
this, isReadOnly);
87 public Texture2D ToDepthTextureCompatible()
89 if ((Description.Flags &
TextureFlags.DepthStencil) == 0)
90 throw new NotSupportedException(
"This texture is not a valid depth stencil texture");
92 var description = Description;
93 description.Format = (
PixelFormat)DepthStencilBuffer.ComputeShaderResourceFormat((Format)Description.Format);
95 throw new NotSupportedException(
"This depth stencil format is not supported");
97 description.Flags = TextureFlags.ShaderResource;
98 return New(GraphicsDevice, description);
ViewType
Defines how a view is selected from a resource.
Same as Deferred mode, except sprites are sorted by texture prior to drawing. This can improve perfor...
PixelFormat
Defines various types of pixel formats.
The texture dimension is 2D.