Viewport.generated.cs 4.5 KB

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