2
0

RenderTarget.cs 3.3 KB

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