Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
RenderTarget.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using SiliconStudio.Core.ReferenceCounting;
4 
5 namespace SiliconStudio.Paradox.Graphics
6 {
7  /// <summary>
8  /// A renderable texture view.
9  /// </summary>
10  public partial class RenderTarget : GraphicsResourceBase
11  {
13 
14  /// <summary>
15  /// The underlying texture.
16  /// </summary>
17  public readonly Texture Texture;
18 
19  /// <summary>
20  /// Gets the width in texel.
21  /// </summary>
22  /// <value>The width.</value>
23  public int Width;
24 
25  /// <summary>
26  /// Gets the height in texel.
27  /// </summary>
28  /// <value>The height.</value>
29  public int Height;
30 
31  /// <summary>
32  /// The format of this texture view.
33  /// </summary>
34  public readonly PixelFormat ViewFormat;
35 
36  /// <summary>
37  /// The format of this texture view.
38  /// </summary>
39  public readonly ViewType ViewType;
40 
41  /// <summary>
42  /// The miplevel index of this texture view.
43  /// </summary>
44  public readonly int MipLevel;
45 
46  /// <summary>
47  /// The array index of this texture view.
48  /// </summary>
49  public readonly int ArraySlice;
50 
51  protected override void Destroy()
52  {
53  base.Destroy();
54  Texture.ReleaseInternal();
55  }
56 
57  /// <summary>
58  /// Performs an implicit conversion from <see cref="RenderTarget"/> to <see cref="Texture"/>.
59  /// </summary>
60  /// <param name="renderTarget">The render target.</param>
61  /// <returns>The result of the conversion.</returns>
62  public static implicit operator Texture(RenderTarget renderTarget)
63  {
64  return renderTarget == null ? null : renderTarget.Texture;
65  }
66  }
67 }
readonly int ArraySlice
The array index of this texture view.
Definition: RenderTarget.cs:49
readonly PixelFormat ViewFormat
The format of this texture view.
Definition: RenderTarget.cs:34
readonly int MipLevel
The miplevel index of this texture view.
Definition: RenderTarget.cs:44
readonly TextureDescription Description
Definition: RenderTarget.cs:12
A Common description for all textures.
int Width
Gets the width in texel.
Definition: RenderTarget.cs:23
ViewType
Defines how a view is selected from a resource.
Definition: ViewType.cs:31
int Height
Gets the height in texel.
Definition: RenderTarget.cs:29
override void Destroy()
Disposes of object resources.
Definition: RenderTarget.cs:51
readonly ViewType ViewType
The format of this texture view.
Definition: RenderTarget.cs:39
readonly Texture Texture
The underlying texture.
Definition: RenderTarget.cs:17
PixelFormat
Defines various types of pixel formats.
Definition: PixelFormat.cs:32
Base class for texture resources.
Definition: Texture.cs:38