BsRenderTargetEx.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsScriptEnginePrerequisites.h"
  5. #include "RenderAPI/BsRenderTexture.h"
  6. namespace bs
  7. {
  8. /** @addtogroup ScriptInteropEngine
  9. * @{
  10. */
  11. /** @cond SCRIPT_EXTENSIONS */
  12. /** Extension class for RenderTarget, for adding additional functionality for the script interface. */
  13. class BS_SCRIPT_EXPORT(e:RenderTarget) RenderTargetEx
  14. {
  15. public:
  16. /** @copydoc RenderTargetProperties::width */
  17. BS_SCRIPT_EXPORT(e:RenderTarget,n:Width,pr:getter)
  18. static UINT32 getWidth(const SPtr<RenderTarget>& thisPtr);
  19. /** @copydoc RenderTargetProperties::height */
  20. BS_SCRIPT_EXPORT(e:RenderTarget,n:Height,pr:getter)
  21. static UINT32 getHeight(const SPtr<RenderTarget>& thisPtr);
  22. /** @copydoc RenderTargetProperties::hwGamma */
  23. BS_SCRIPT_EXPORT(e:RenderTarget,n:GammaCorrection,pr:getter)
  24. static bool getGammaCorrection(const SPtr<RenderTarget>& thisPtr);
  25. /** @copydoc RenderTargetProperties::priority */
  26. BS_SCRIPT_EXPORT(e:RenderTarget,n:Priority,pr:getter)
  27. static INT32 getPriority(const SPtr<RenderTarget>& thisPtr);
  28. /** @copydoc RenderTargetProperties::priority */
  29. BS_SCRIPT_EXPORT(e:RenderTarget,n:Priority,pr:setter)
  30. static void setPriority(const SPtr<RenderTarget>& thisPtr, INT32 priority);
  31. /** @copydoc RenderTargetProperties::multisampleCount */
  32. BS_SCRIPT_EXPORT(e:RenderTarget,n:SampleCount,pr:getter)
  33. static UINT32 getSampleCount(const SPtr<RenderTarget>& thisPtr);
  34. };
  35. /** Extension class for RenderTexture, for adding additional functionality for the script interface. */
  36. class BS_SCRIPT_EXPORT(e:RenderTexture) RenderTextureEx
  37. {
  38. public:
  39. /**
  40. * Creates a new 2D render texture.
  41. *
  42. * @param[in] format Pixel format of the texture. Format must be a valid uncompressed color format.
  43. * @param[in] width Width of the texture in pixels.
  44. * @param[in] height Height of the texture in pixels.
  45. * @param[in] numSamples Number of samples contained per pixel.
  46. * @param[in] gammaCorrection Determines should the pixels written on the texture be gamma corrected.
  47. * @param[in] createDepth Should the render texture also contain a depth/stencil buffer.
  48. * @param[in] depthStencilFormat Format of the depth/stencil buffer, if @p createDepth is enabled. Format must
  49. * be a valid depth/stencil format.
  50. */
  51. BS_SCRIPT_EXPORT(ec:RenderTexture)
  52. static SPtr<RenderTexture> create(PixelFormat format, int width, int height, int numSamples = 1, bool gammaCorrection = false,
  53. bool createDepth = false, PixelFormat depthStencilFormat = PF_D32);
  54. /**
  55. * Creates a new 2D render texture using an existing color texture, and no depth-stencil texture.
  56. *
  57. * @param[in] colorSurface Color texture to render color data to.
  58. */
  59. BS_SCRIPT_EXPORT(ec:RenderTexture)
  60. static SPtr<RenderTexture> create(const HTexture& colorSurface);
  61. /**
  62. * Creates a new 2D render texture using existing textures as render destinations.
  63. *
  64. * @param[in] colorSurface Color texture to render color data to.
  65. * @param[in] depthStencilSurface Optional depth/stencil texture to render depth/stencil data to.
  66. */
  67. BS_SCRIPT_EXPORT(ec:RenderTexture)
  68. static SPtr<RenderTexture> create(const HTexture& colorSurface, const HTexture& depthStencilSurface);
  69. /**
  70. * Creates a new 2D render texture using one or multiple color textures and no depth-stencil texture.
  71. *
  72. * @param[in] colorSurface Color texture(s) to render color data to.
  73. */
  74. BS_SCRIPT_EXPORT(ec:RenderTexture)
  75. static SPtr<RenderTexture> create(const Vector<HTexture>& colorSurface);
  76. /**
  77. * Creates a new 2D render texture using one or multiple color textures and a depth/stencil texture.
  78. *
  79. * @param[in] colorSurface Color texture(s) to render color data to.
  80. * @param[in] depthStencilSurface Optional depth/stencil texture to render depth/stencil data to.
  81. */
  82. BS_SCRIPT_EXPORT(ec:RenderTexture)
  83. static SPtr<RenderTexture> create(const Vector<HTexture>& colorSurface, const HTexture& depthStencilSurface);
  84. /** Returns the primary color surface that contains rendered color data. */
  85. BS_SCRIPT_EXPORT(e:RenderTexture,n:ColorSurface,pr:getter)
  86. static HTexture getColorSurface(const SPtr<RenderTexture>& thisPtr);
  87. /** Returns all the color surfaces. */
  88. BS_SCRIPT_EXPORT(e:RenderTexture,n:ColorSurfaces,pr:getter)
  89. static Vector<HTexture> getColorSurfaces(const SPtr<RenderTexture>& thisPtr);
  90. /** Returns the depth/stencil surface that contains rendered depth and stencil data. */
  91. BS_SCRIPT_EXPORT(e:RenderTexture,n:DepthStencilSurface,pr:getter)
  92. static HTexture getDepthStencilSurface(const SPtr<RenderTexture>& thisPtr);
  93. };
  94. /** @endcond */
  95. /** @} */
  96. }