2
0

RenderTarget.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. using System;
  4. using System.Runtime.CompilerServices;
  5. namespace BansheeEngine
  6. {
  7. /** @addtogroup Rendering
  8. * @{
  9. */
  10. /// <summary>
  11. /// Render target is a frame buffer or a texture that the render system renders the scene to.
  12. /// </summary>
  13. public class RenderTarget : ScriptObject
  14. {
  15. /// <summary>
  16. /// Returns the width of the render target, in pixels.
  17. /// </summary>
  18. public int Width
  19. {
  20. get
  21. {
  22. int value;
  23. Internal_GetWidth(mCachedPtr, out value);
  24. return value;
  25. }
  26. }
  27. /// <summary>
  28. /// Returns the height of the render target, in pixels.
  29. /// </summary>
  30. public int Height
  31. {
  32. get
  33. {
  34. int value;
  35. Internal_GetHeight(mCachedPtr, out value);
  36. return value;
  37. }
  38. }
  39. /// <summary>
  40. /// Returns true if pixels written to the render target will be gamma corrected.
  41. /// </summary>
  42. public bool GammaCorrection
  43. {
  44. get
  45. {
  46. bool value;
  47. Internal_GetGammaCorrection(mCachedPtr, out value);
  48. return value;
  49. }
  50. }
  51. /// <summary>
  52. /// Gets the number of samples used for multisampling (0 or 1 if multisampling is not used).
  53. /// </summary>
  54. public int SampleCount
  55. {
  56. get
  57. {
  58. int value;
  59. Internal_GetSampleCount(mCachedPtr, out value);
  60. return value;
  61. }
  62. }
  63. /// <summary>
  64. /// Controls in what order is the render target rendered to compared to other render targets. Targets with higher
  65. /// priority will be rendered before ones with lower priority.
  66. /// </summary>
  67. public int Priority
  68. {
  69. get
  70. {
  71. int value;
  72. Internal_GetPriority(mCachedPtr, out value);
  73. return value;
  74. }
  75. set
  76. {
  77. Internal_SetPriority(mCachedPtr, value);
  78. }
  79. }
  80. [MethodImpl(MethodImplOptions.InternalCall)]
  81. private static extern void Internal_GetWidth(IntPtr thisPtr, out int value);
  82. [MethodImpl(MethodImplOptions.InternalCall)]
  83. private static extern void Internal_GetHeight(IntPtr thisPtr, out int value);
  84. [MethodImpl(MethodImplOptions.InternalCall)]
  85. private static extern void Internal_GetGammaCorrection(IntPtr thisPtr, out bool value);
  86. [MethodImpl(MethodImplOptions.InternalCall)]
  87. private static extern void Internal_GetSampleCount(IntPtr thisPtr, out int value);
  88. [MethodImpl(MethodImplOptions.InternalCall)]
  89. private static extern void Internal_GetPriority(IntPtr thisPtr, out int value);
  90. [MethodImpl(MethodImplOptions.InternalCall)]
  91. private static extern void Internal_SetPriority(IntPtr thisPtr, int value);
  92. }
  93. /** @} */
  94. }