RenderTexture.generated.cs 4.8 KB

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