RenderTexture.generated.cs 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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 is enabled. Format must be a valid depth/stencil format.
  26. /// </param>
  27. public RenderTexture(PixelFormat format, int width, int height, int numSamples = 1, bool gammaCorrection = false, bool createDepth = false, PixelFormat depthStencilFormat = PixelFormat.D32)
  28. {
  29. Internal_create(this, format, width, height, numSamples, gammaCorrection, createDepth, depthStencilFormat);
  30. }
  31. /// <summary>Creates a new 2D render texture using an existing color texture, and no depth-stencil texture.</summary>
  32. /// <param name="colorSurface">Color texture to render color data to.</param>
  33. public RenderTexture(Texture colorSurface)
  34. {
  35. Internal_create0(this, colorSurface);
  36. }
  37. /// <summary>Creates a new 2D render texture using existing textures as render destinations.</summary>
  38. /// <param name="colorSurface">Color texture to render color data to.</param>
  39. /// <param name="depthStencilSurface">Optional depth/stencil texture to render depth/stencil data to.</param>
  40. public RenderTexture(Texture colorSurface, Texture depthStencilSurface)
  41. {
  42. Internal_create1(this, colorSurface, depthStencilSurface);
  43. }
  44. /// <summary>Creates a new 2D render texture using one or multiple color textures and no depth-stencil texture.</summary>
  45. /// <param name="colorSurface">Color texture(s) to render color data to.</param>
  46. public RenderTexture(Texture[] colorSurface)
  47. {
  48. Internal_create2(this, colorSurface);
  49. }
  50. /// <summary>Creates a new 2D render texture using one or multiple color textures and a depth/stencil texture.</summary>
  51. /// <param name="colorSurface">Color texture(s) to render color data to.</param>
  52. /// <param name="depthStencilSurface">Optional depth/stencil texture to render depth/stencil data to.</param>
  53. public RenderTexture(Texture[] colorSurface, Texture depthStencilSurface)
  54. {
  55. Internal_create3(this, colorSurface, depthStencilSurface);
  56. }
  57. /// <summary>Returns the primary color surface that contains rendered color data.</summary>
  58. public Texture ColorSurface
  59. {
  60. get { return Internal_getColorSurface(mCachedPtr); }
  61. }
  62. /// <summary>Returns all the color surfaces.</summary>
  63. public Texture[] ColorSurfaces
  64. {
  65. get { return Internal_getColorSurfaces(mCachedPtr); }
  66. }
  67. /// <summary>Returns the depth/stencil surface that contains rendered depth and stencil data.</summary>
  68. public Texture DepthStencilSurface
  69. {
  70. get { return Internal_getDepthStencilSurface(mCachedPtr); }
  71. }
  72. [MethodImpl(MethodImplOptions.InternalCall)]
  73. private static extern void Internal_create(RenderTexture managedInstance, PixelFormat format, int width, int height, int numSamples, bool gammaCorrection, bool createDepth, PixelFormat depthStencilFormat);
  74. [MethodImpl(MethodImplOptions.InternalCall)]
  75. private static extern void Internal_create0(RenderTexture managedInstance, Texture colorSurface);
  76. [MethodImpl(MethodImplOptions.InternalCall)]
  77. private static extern void Internal_create1(RenderTexture managedInstance, Texture colorSurface, Texture depthStencilSurface);
  78. [MethodImpl(MethodImplOptions.InternalCall)]
  79. private static extern void Internal_create2(RenderTexture managedInstance, Texture[] colorSurface);
  80. [MethodImpl(MethodImplOptions.InternalCall)]
  81. private static extern void Internal_create3(RenderTexture managedInstance, Texture[] colorSurface, Texture depthStencilSurface);
  82. [MethodImpl(MethodImplOptions.InternalCall)]
  83. private static extern Texture Internal_getColorSurface(IntPtr thisPtr);
  84. [MethodImpl(MethodImplOptions.InternalCall)]
  85. private static extern Texture[] Internal_getColorSurfaces(IntPtr thisPtr);
  86. [MethodImpl(MethodImplOptions.InternalCall)]
  87. private static extern Texture Internal_getDepthStencilSurface(IntPtr thisPtr);
  88. }
  89. /** @} */
  90. }