RenderInstances.h 860 B

12345678910111213141516171819202122232425262728
  1. // Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
  2. // SPDX-FileCopyrightText: 2021 Jorrit Rouwe
  3. // SPDX-License-Identifier: MIT
  4. #pragma once
  5. #include <Jolt/Core/Reference.h>
  6. class RenderPrimitive;
  7. /// Buffer that holds a list of instances (usually model transform etc.) for instance based rendering
  8. class RenderInstances : public RefTarget<RenderInstances>
  9. {
  10. public:
  11. /// Destructor
  12. virtual ~RenderInstances() = default;
  13. /// Erase all instance data
  14. virtual void Clear() = 0;
  15. /// Instance buffer management functions
  16. virtual void CreateBuffer(int inNumInstances, int inInstanceSize) = 0;
  17. virtual void * Lock() = 0;
  18. virtual void Unlock() = 0;
  19. /// Draw the instances when context has been set by Renderer::BindShader
  20. virtual void Draw(RenderPrimitive *inPrimitive, int inStartInstance, int inNumInstances) const = 0;
  21. };