RenderTarget.cs 3.0 KB

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