BsRenderableHandler.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #pragma once
  2. #include "BsPrerequisites.h"
  3. namespace BansheeEngine
  4. {
  5. /**
  6. * Abstract class that provides an interface for initializing
  7. * renderable elements of a certain type, along with their GPU
  8. * parameter buffers.
  9. *
  10. * Essentially this class holds all the information that is needed for rendering
  11. * an element of a certain renderable type.
  12. *
  13. * @note e.g. elements that have shadows would have a RenderableLitShadowHandler
  14. * and elements that can be animated would have RenderableAnimatedHandler,
  15. * or a combination of the two.
  16. */
  17. class BS_EXPORT RenderableHandler
  18. {
  19. public:
  20. /**
  21. * @brief Initializes the specified renderable element, making it ready
  22. * to be used. Caller must ensure the renderable element actually
  23. * supports this handler.
  24. */
  25. virtual void initializeRenderElem(RenderableElement* element) = 0;
  26. /**
  27. * @brief Binds per object GPU parameter buffers to the provided element.
  28. */
  29. virtual void bindPerObjectBuffers(const RenderableElement* element) = 0;
  30. /**
  31. * @brief Binds global GPU parameter buffers used for this Renderable
  32. * type to the provided element.
  33. */
  34. virtual void bindGlobalBuffers(const RenderableElement* element);
  35. };
  36. }