BsRenderableController.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 RenderableController
  18. {
  19. public:
  20. virtual ~RenderableController() {}
  21. /**
  22. * @brief Initializes the specified renderable element, making it ready
  23. * to be used. Caller must ensure the renderable element actually
  24. * supports this handler.
  25. */
  26. virtual void initializeRenderElem(RenderableElement& element) = 0;
  27. /**
  28. * @brief Binds per object GPU parameter buffers to the provided element.
  29. */
  30. virtual void bindPerObjectBuffers(const RenderableElement& element) = 0;
  31. /**
  32. * @brief Binds global GPU parameter buffers used for this Renderable
  33. * type to the provided element.
  34. */
  35. virtual void bindGlobalBuffers(const RenderableElement& element);
  36. };
  37. }