BsMeshManager.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 VertexDataDescPtr&, int, DrawOperationType, IndexType) */
  19. MeshPtr create(UINT32 numVertices, UINT32 numIndices, const VertexDataDescPtr& vertexDesc, int usage = MU_STATIC,
  20. DrawOperationType drawOp = DOT_TRIANGLE_LIST, IndexType indexType = IT_32BIT);
  21. /** @copydoc Mesh::create(UINT32, UINT32, const VertexDataDescPtr&, const Vector<SubMesh>&, int, IndexType) */
  22. MeshPtr create(UINT32 numVertices, UINT32 numIndices, const VertexDataDescPtr& vertexDesc, const Vector<SubMesh>& subMeshes,
  23. int usage = MU_STATIC, IndexType indexType = IT_32BIT);
  24. /** @copyodc Mesh::create(const MeshDataPtr&, int, DrawOperationType) */
  25. MeshPtr create(const MeshDataPtr& initialData, int usage = MU_STATIC, DrawOperationType drawOp = DOT_TRIANGLE_LIST);
  26. /** @copyodc Mesh::create(const MeshDataPtr&, const Vector<SubMesh>&, int) */
  27. MeshPtr create(const MeshDataPtr& initialData, const Vector<SubMesh>& subMeshes, int usage = MU_STATIC);
  28. /**
  29. * Creates a new empty and uninitialized mesh. You will need to manually initialize the mesh before using it.
  30. *
  31. * @note This should only be used for special cases and is not meant for normal use.
  32. */
  33. MeshPtr createEmpty();
  34. /** Returns some dummy mesh data with one triangle you may use for initializing a mesh. */
  35. MeshDataPtr getDummyMeshData() const { return mDummyMeshData; }
  36. /** Returns a dummy mesh containing one triangle. */
  37. HMesh getDummyMesh() const { return mDummyMesh; }
  38. protected:
  39. /** @copydoc Module::onStartUp */
  40. virtual void onStartUp() override;
  41. private:
  42. MeshDataPtr mDummyMeshData;
  43. HMesh mDummyMesh;
  44. };
  45. /** @} */
  46. }