BsMeshManager.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #pragma once
  2. #include "BsCorePrerequisites.h"
  3. #include "BsModule.h"
  4. #include "BsMesh.h"
  5. namespace BansheeEngine
  6. {
  7. /** @cond INTERNAL */
  8. /** @addtogroup RenderAPI
  9. * @{
  10. */
  11. /** Manager that handles creation of Mesh%es. */
  12. class BS_CORE_EXPORT MeshManager : public Module<MeshManager>
  13. {
  14. public:
  15. MeshManager();
  16. ~MeshManager();
  17. /** @copydoc Mesh::create(UINT32, UINT32, const VertexDataDescPtr&, int, DrawOperationType, IndexType) */
  18. MeshPtr create(UINT32 numVertices, UINT32 numIndices, const VertexDataDescPtr& vertexDesc, int usage = MU_STATIC,
  19. DrawOperationType drawOp = DOT_TRIANGLE_LIST, IndexType indexType = IT_32BIT);
  20. /** @copydoc Mesh::create(UINT32, UINT32, const VertexDataDescPtr&, const Vector<SubMesh>&, int, IndexType) */
  21. MeshPtr create(UINT32 numVertices, UINT32 numIndices, const VertexDataDescPtr& vertexDesc, const Vector<SubMesh>& subMeshes,
  22. int usage = MU_STATIC, IndexType indexType = IT_32BIT);
  23. /** @copyodc Mesh::create(const MeshDataPtr&, int, DrawOperationType) */
  24. MeshPtr create(const MeshDataPtr& initialData, int usage = MU_STATIC, DrawOperationType drawOp = DOT_TRIANGLE_LIST);
  25. /** @copyodc Mesh::create(const MeshDataPtr&, const Vector<SubMesh>&, int) */
  26. MeshPtr create(const MeshDataPtr& initialData, const Vector<SubMesh>& subMeshes, int usage = MU_STATIC);
  27. /**
  28. * Creates a new empty and uninitialized mesh. You will need to manually initialize the mesh before using it.
  29. *
  30. * @note This should only be used for special cases and is not meant for normal use.
  31. */
  32. MeshPtr createEmpty();
  33. /** Returns some dummy mesh data with one triangle you may use for initializing a mesh. */
  34. MeshDataPtr getDummyMeshData() const { return mDummyMeshData; }
  35. /** Returns a dummy mesh containing one triangle. */
  36. HMesh getDummyMesh() const { return mDummyMesh; }
  37. protected:
  38. /** @copydoc Module::onStartUp */
  39. virtual void onStartUp() override;
  40. private:
  41. MeshDataPtr mDummyMeshData;
  42. HMesh mDummyMesh;
  43. };
  44. /** @} */
  45. /** @endcond */
  46. }