RenderTexture.generated.cs 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. public Texture ColorSurface
  62. {
  63. get { return Internal_getColorSurface(mCachedPtr); }
  64. }
  65. /// <summary>Returns all the color surfaces.</summary>
  66. [ShowInInspector]
  67. public Texture[] ColorSurfaces
  68. {
  69. get { return Internal_getColorSurfaces(mCachedPtr); }
  70. }
  71. /// <summary>Returns the depth/stencil surface that contains rendered depth and stencil data.</summary>
  72. [ShowInInspector]
  73. public Texture DepthStencilSurface
  74. {
  75. get { return Internal_getDepthStencilSurface(mCachedPtr); }
  76. }
  77. [MethodImpl(MethodImplOptions.InternalCall)]
  78. private static extern void Internal_create(RenderTexture managedInstance, PixelFormat format, int width, int height, int numSamples, bool gammaCorrection, bool createDepth, PixelFormat depthStencilFormat);
  79. [MethodImpl(MethodImplOptions.InternalCall)]
  80. private static extern void Internal_create0(RenderTexture managedInstance, Texture colorSurface);
  81. [MethodImpl(MethodImplOptions.InternalCall)]
  82. private static extern void Internal_create1(RenderTexture managedInstance, Texture colorSurface, Texture depthStencilSurface);
  83. [MethodImpl(MethodImplOptions.InternalCall)]
  84. private static extern void Internal_create2(RenderTexture managedInstance, Texture[] colorSurface);
  85. [MethodImpl(MethodImplOptions.InternalCall)]
  86. private static extern void Internal_create3(RenderTexture managedInstance, Texture[] colorSurface, Texture depthStencilSurface);
  87. [MethodImpl(MethodImplOptions.InternalCall)]
  88. private static extern Texture Internal_getColorSurface(IntPtr thisPtr);
  89. [MethodImpl(MethodImplOptions.InternalCall)]
  90. private static extern Texture[] Internal_getColorSurfaces(IntPtr thisPtr);
  91. [MethodImpl(MethodImplOptions.InternalCall)]
  92. private static extern Texture Internal_getDepthStencilSurface(IntPtr thisPtr);
  93. }
  94. /** @} */
  95. }