BsMeshManager.h 2.6 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. /** @addtogroup RenderAPI-Internal
  10. * @{
  11. */
  12. /** Manager that handles creation of Mesh%es. */
  13. class BS_CORE_EXPORT MeshManager : public Module<MeshManager>
  14. {
  15. public:
  16. MeshManager();
  17. ~MeshManager();
  18. /** @copydoc Mesh::create(UINT32, UINT32, const SPtr<VertexDataDesc>&, int, DrawOperationType, IndexType, const SPtr<Skeleton>&) */
  19. SPtr<Mesh> create(UINT32 numVertices, UINT32 numIndices, const SPtr<VertexDataDesc>& vertexDesc, int usage = MU_STATIC,
  20. DrawOperationType drawOp = DOT_TRIANGLE_LIST, IndexType indexType = IT_32BIT, const SPtr<Skeleton>& skeleton = nullptr);
  21. /** @copydoc Mesh::create(UINT32, UINT32, const SPtr<VertexDataDesc>&, const Vector<SubMesh>&, int, IndexType, const SPtr<Skeleton>&) */
  22. SPtr<Mesh> create(UINT32 numVertices, UINT32 numIndices, const SPtr<VertexDataDesc>& vertexDesc, const Vector<SubMesh>& subMeshes,
  23. int usage = MU_STATIC, IndexType indexType = IT_32BIT, const SPtr<Skeleton>& skeleton = nullptr);
  24. /** @copydoc Mesh::create(const SPtr<MeshData>&, int, DrawOperationType, const SPtr<Skeleton>&) */
  25. SPtr<Mesh> create(const SPtr<MeshData>& initialData, int usage = MU_STATIC, DrawOperationType drawOp = DOT_TRIANGLE_LIST,
  26. const SPtr<Skeleton>& skeleton = nullptr);
  27. /** @copydoc Mesh::create(const SPtr<MeshData>&, const Vector<SubMesh>&, int, const SPtr<Skeleton>&) */
  28. SPtr<Mesh> create(const SPtr<MeshData>& initialData, const Vector<SubMesh>& subMeshes, int usage = MU_STATIC,
  29. const SPtr<Skeleton>& skeleton = nullptr);
  30. /**
  31. * Creates a new empty and uninitialized mesh. You will need to manually initialize the mesh before using it.
  32. *
  33. * @note This should only be used for special cases and is not meant for normal use.
  34. */
  35. SPtr<Mesh> createEmpty();
  36. /** Returns some dummy mesh data with one triangle you may use for initializing a mesh. */
  37. SPtr<MeshData> getDummyMeshData() const { return mDummyMeshData; }
  38. /** Returns a dummy mesh containing one triangle. */
  39. HMesh getDummyMesh() const { return mDummyMesh; }
  40. protected:
  41. /** @copydoc Module::onStartUp */
  42. virtual void onStartUp() override;
  43. private:
  44. SPtr<MeshData> mDummyMeshData;
  45. HMesh mDummyMesh;
  46. };
  47. /** @} */
  48. }