2
0

RenderTexture.generated.cs 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. using System;
  2. using System.Runtime.CompilerServices;
  3. using System.Runtime.InteropServices;
  4. namespace BansheeEngine
  5. {
  6. /** @addtogroup Rendering
  7. * @{
  8. */
  9. /// <summary>
  10. /// Render target specialization that allows you to render into one or multiple textures. Such textures can then be used
  11. /// in other operations as GPU program input.
  12. /// </summary>
  13. [ShowInInspector]
  14. public partial class RenderTexture : RenderTarget
  15. {
  16. private RenderTexture(bool __dummy0) { }
  17. protected RenderTexture() { }
  18. /// <summary>Creates a new 2D render texture.</summary>
  19. /// <param name="format">Pixel format of the texture. Format must be a valid uncompressed color format.</param>
  20. /// <param name="width">Width of the texture in pixels.</param>
  21. /// <param name="height">Height of the texture in pixels.</param>
  22. /// <param name="numSamples">Number of samples contained per pixel.</param>
  23. /// <param name="gammaCorrection">Determines should the pixels written on the texture be gamma corrected.</param>
  24. /// <param name="createDepth">Should the render texture also contain a depth/stencil buffer.</param>
  25. /// <param name="depthStencilFormat">
  26. /// Format of the depth/stencil buffer, if <paramref name="createDepth"/> is enabled. Format must be a valid
  27. /// depth/stencil format.
  28. /// </param>
  29. public RenderTexture(PixelFormat format, int width, int height, int numSamples = 1, bool gammaCorrection = false, bool createDepth = false, PixelFormat depthStencilFormat = PixelFormat.D32)
  30. {
  31. Internal_create(this, format, width, height, numSamples, gammaCorrection, createDepth, depthStencilFormat);
  32. }
  33. /// <summary>Creates a new 2D render texture using an existing color texture, and no depth-stencil texture.</summary>
  34. /// <param name="colorSurface">Color texture to render color data to.</param>
  35. public RenderTexture(Texture colorSurface)
  36. {
  37. Internal_create0(this, colorSurface);
  38. }
  39. /// <summary>Creates a new 2D render texture using existing textures as render destinations.</summary>
  40. /// <param name="colorSurface">Color texture to render color data to.</param>
  41. /// <param name="depthStencilSurface">Optional depth/stencil texture to render depth/stencil data to.</param>
  42. public RenderTexture(Texture colorSurface, Texture depthStencilSurface)
  43. {
  44. Internal_create1(this, colorSurface, depthStencilSurface);
  45. }
  46. /// <summary>Creates a new 2D render texture using one or multiple color textures and no depth-stencil texture.</summary>
  47. /// <param name="colorSurface">Color texture(s) to render color data to.</param>
  48. public RenderTexture(Texture[] colorSurface)
  49. {
  50. Internal_create2(this, colorSurface);
  51. }
  52. /// <summary>Creates a new 2D render texture using one or multiple color textures and a depth/stencil texture.</summary>
  53. /// <param name="colorSurface">Color texture(s) to render color data to.</param>
  54. /// <param name="depthStencilSurface">Optional depth/stencil texture to render depth/stencil data to.</param>
  55. public RenderTexture(Texture[] colorSurface, Texture depthStencilSurface)
  56. {
  57. Internal_create3(this, colorSurface, depthStencilSurface);
  58. }
  59. /// <summary>Returns the primary color surface that contains rendered color data.</summary>
  60. [ShowInInspector]
  61. [NativeWrapper]
  62. public Texture ColorSurface
  63. {
  64. get { return Internal_getColorSurface(mCachedPtr); }
  65. }
  66. /// <summary>Returns all the color surfaces.</summary>
  67. [ShowInInspector]
  68. [NativeWrapper]
  69. public Texture[] ColorSurfaces
  70. {
  71. get { return Internal_getColorSurfaces(mCachedPtr); }
  72. }
  73. /// <summary>Returns the depth/stencil surface that contains rendered depth and stencil data.</summary>
  74. [ShowInInspector]
  75. [NativeWrapper]
  76. public Texture DepthStencilSurface
  77. {
  78. get { return Internal_getDepthStencilSurface(mCachedPtr); }
  79. }
  80. [MethodImpl(MethodImplOptions.InternalCall)]
  81. private static extern void Internal_create(RenderTexture managedInstance, PixelFormat format, int width, int height, int numSamples, bool gammaCorrection, bool createDepth, PixelFormat depthStencilFormat);
  82. [MethodImpl(MethodImplOptions.InternalCall)]
  83. private static extern void Internal_create0(RenderTexture managedInstance, Texture colorSurface);
  84. [MethodImpl(MethodImplOptions.InternalCall)]
  85. private static extern void Internal_create1(RenderTexture managedInstance, Texture colorSurface, Texture depthStencilSurface);
  86. [MethodImpl(MethodImplOptions.InternalCall)]
  87. private static extern void Internal_create2(RenderTexture managedInstance, Texture[] colorSurface);
  88. [MethodImpl(MethodImplOptions.InternalCall)]
  89. private static extern void Internal_create3(RenderTexture managedInstance, Texture[] colorSurface, Texture depthStencilSurface);
  90. [MethodImpl(MethodImplOptions.InternalCall)]
  91. private static extern Texture Internal_getColorSurface(IntPtr thisPtr);
  92. [MethodImpl(MethodImplOptions.InternalCall)]
  93. private static extern Texture[] Internal_getColorSurfaces(IntPtr thisPtr);
  94. [MethodImpl(MethodImplOptions.InternalCall)]
  95. private static extern Texture Internal_getDepthStencilSurface(IntPtr thisPtr);
  96. }
  97. /** @} */
  98. }