BsRenderableElement.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #pragma once
  2. #include "BsPrerequisites.h"
  3. #include "BsBounds.h"
  4. #include "BsMatrix4.h"
  5. #include "BsSubMesh.h"
  6. namespace BansheeEngine
  7. {
  8. /**
  9. * @brief Contains all information needed for rendering a single
  10. * sub-mesh. Closely tied with Renderer.
  11. */
  12. class BS_EXPORT RenderableElement
  13. {
  14. public:
  15. /**
  16. * @brief Contains a hardware GPU parameter buffer and index of the parameters and the slot
  17. * it binds to in a material.
  18. */
  19. struct BS_EXPORT BufferBindInfo
  20. {
  21. BufferBindInfo(UINT32 passIdx, UINT32 paramsIdx, UINT32 slotIdx, const SPtr<GpuParamBlockBufferCore>& buffer)
  22. :passIdx(passIdx), paramsIdx(paramsIdx), slotIdx(slotIdx), buffer(buffer)
  23. { }
  24. UINT32 passIdx;
  25. UINT32 paramsIdx;
  26. UINT32 slotIdx;
  27. SPtr<GpuParamBlockBufferCore> buffer;
  28. };
  29. /**
  30. * @brief Reference to the mesh to render.
  31. */
  32. SPtr<MeshCore> mesh;
  33. /**
  34. * @brief Portion of the mesh to render.
  35. */
  36. SubMesh subMesh;
  37. /**
  38. * @brief Proxy of the material to render the mesh with.
  39. */
  40. SPtr<MaterialCore> material;
  41. /**
  42. * @brief Custom data that may optionally be set by the RenderableHanbdler.
  43. */
  44. Any rendererData;
  45. Vector<BufferBindInfo> rendererBuffers;
  46. };
  47. }