2
0

BsMeshManager.h 2.3 KB

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