BsRendererUtility.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #pragma once
  2. #include "BsCorePrerequisites.h"
  3. #include "BsModule.h"
  4. namespace BansheeEngine
  5. {
  6. /**
  7. * @brief Contains various utility methods that make various common operations in the renderer easier.
  8. *
  9. * @note Core thread only.
  10. */
  11. class BS_CORE_EXPORT RendererUtility : public Module<RendererUtility>
  12. {
  13. public:
  14. RendererUtility();
  15. ~RendererUtility();
  16. /**
  17. * @brief Activates the specified material pass for rendering. Any further draw calls will be executed using
  18. * this pass.
  19. *
  20. * @param material Material containing the pass.
  21. * @param passIdx Index of the pass in the material.
  22. *
  23. * @note Core thread.
  24. */
  25. void setPass(const SPtr<MaterialCore>& material, UINT32 passIdx);
  26. /**
  27. * @brief Draws the specified mesh.
  28. *
  29. * @note Core thread.
  30. */
  31. void draw(const SPtr<MeshCoreBase>& mesh, const SubMesh& subMesh);
  32. /**
  33. * @brief Draws a quad over the entire viewport in normalized device coordinates.
  34. *
  35. * @note Core thread.
  36. */
  37. void drawScreenQuad(const CameraCore& camera);
  38. private:
  39. SPtr<MeshCore> mFullScreenQuadMesh;
  40. };
  41. /**
  42. * @brief Provides global access to the renderer utility.
  43. *
  44. * @note Core thread only.
  45. */
  46. BS_CORE_EXPORT RendererUtility& gRendererUtility();
  47. }