Viewport.generated.cs 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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. /// Viewport determines to which RenderTarget should rendering be performed. It allows you to render to a sub-region of
  11. /// the target by specifying the area rectangle, and allows you to set up color/depth/stencil clear values for that
  12. /// specific region.
  13. /// </summary>
  14. [ShowInInspector]
  15. public partial class Viewport : ScriptObject
  16. {
  17. private Viewport(bool __dummy0) { }
  18. protected Viewport() { }
  19. /// <summary>Creates a new viewport.</summary>
  20. public Viewport(RenderTarget target, float x = 0f, float y = 0f, float width = 1f, float height = 1f)
  21. {
  22. Internal_create(this, target, x, y, width, height);
  23. }
  24. /// <summary>Determines the render target the viewport is associated with.</summary>
  25. [ShowInInspector]
  26. public RenderTarget Target
  27. {
  28. get { return Internal_getTarget(mCachedPtr); }
  29. set { Internal_setTarget(mCachedPtr, value); }
  30. }
  31. /// <summary>Determines the area that the viewport covers. Coordinates are in normalized [0, 1] range.</summary>
  32. [ShowInInspector]
  33. public Rect2 Area
  34. {
  35. get
  36. {
  37. Rect2 temp;
  38. Internal_getArea(mCachedPtr, out temp);
  39. return temp;
  40. }
  41. set { Internal_setArea(mCachedPtr, ref value); }
  42. }
  43. /// <summary>Returns the area of the render target covered by the viewport, in pixels.</summary>
  44. [ShowInInspector]
  45. public Rect2I PixelArea
  46. {
  47. get
  48. {
  49. Rect2I temp;
  50. Internal_getPixelArea(mCachedPtr, out temp);
  51. return temp;
  52. }
  53. }
  54. /// <summary>
  55. /// Determines which portions of the render target should be cleared before rendering to this viewport is performed.
  56. /// </summary>
  57. [ShowInInspector]
  58. public ClearFlags ClearFlags
  59. {
  60. get { return Internal_getClearFlags(mCachedPtr); }
  61. set { Internal_setClearFlags(mCachedPtr, value); }
  62. }
  63. /// <summary>Determines the color to clear the viewport to before rendering, if color clear is enabled.</summary>
  64. [ShowInInspector]
  65. public Color ClearColor
  66. {
  67. get
  68. {
  69. Color temp;
  70. Internal_getClearColorValue(mCachedPtr, out temp);
  71. return temp;
  72. }
  73. set { Internal_setClearColorValue(mCachedPtr, ref value); }
  74. }
  75. /// <summary>Determines the value to clear the depth buffer to before rendering, if depth clear is enabled.</summary>
  76. [ShowInInspector]
  77. public float ClearDepth
  78. {
  79. get { return Internal_getClearDepthValue(mCachedPtr); }
  80. set { Internal_setClearDepthValue(mCachedPtr, value); }
  81. }
  82. /// <summary>Determines the value to clear the stencil buffer to before rendering, if stencil clear is enabled.</summary>
  83. [ShowInInspector]
  84. public ushort ClearStencil
  85. {
  86. get { return Internal_getClearStencilValue(mCachedPtr); }
  87. set { Internal_setClearStencilValue(mCachedPtr, value); }
  88. }
  89. [MethodImpl(MethodImplOptions.InternalCall)]
  90. private static extern void Internal_setTarget(IntPtr thisPtr, RenderTarget target);
  91. [MethodImpl(MethodImplOptions.InternalCall)]
  92. private static extern RenderTarget Internal_getTarget(IntPtr thisPtr);
  93. [MethodImpl(MethodImplOptions.InternalCall)]
  94. private static extern void Internal_setArea(IntPtr thisPtr, ref Rect2 area);
  95. [MethodImpl(MethodImplOptions.InternalCall)]
  96. private static extern void Internal_getArea(IntPtr thisPtr, out Rect2 __output);
  97. [MethodImpl(MethodImplOptions.InternalCall)]
  98. private static extern void Internal_getPixelArea(IntPtr thisPtr, out Rect2I __output);
  99. [MethodImpl(MethodImplOptions.InternalCall)]
  100. private static extern void Internal_setClearFlags(IntPtr thisPtr, ClearFlags flags);
  101. [MethodImpl(MethodImplOptions.InternalCall)]
  102. private static extern ClearFlags Internal_getClearFlags(IntPtr thisPtr);
  103. [MethodImpl(MethodImplOptions.InternalCall)]
  104. private static extern void Internal_setClearColorValue(IntPtr thisPtr, ref Color color);
  105. [MethodImpl(MethodImplOptions.InternalCall)]
  106. private static extern void Internal_getClearColorValue(IntPtr thisPtr, out Color __output);
  107. [MethodImpl(MethodImplOptions.InternalCall)]
  108. private static extern void Internal_setClearDepthValue(IntPtr thisPtr, float depth);
  109. [MethodImpl(MethodImplOptions.InternalCall)]
  110. private static extern float Internal_getClearDepthValue(IntPtr thisPtr);
  111. [MethodImpl(MethodImplOptions.InternalCall)]
  112. private static extern void Internal_setClearStencilValue(IntPtr thisPtr, ushort value);
  113. [MethodImpl(MethodImplOptions.InternalCall)]
  114. private static extern ushort Internal_getClearStencilValue(IntPtr thisPtr);
  115. [MethodImpl(MethodImplOptions.InternalCall)]
  116. private static extern void Internal_create(Viewport managedInstance, RenderTarget target, float x, float y, float width, float height);
  117. }
  118. /** @} */
  119. }