IVertexBuffer.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // Copyright (C) 2008-2012 Nikolaus Gebhardt
  2. // This file is part of the "Irrlicht Engine".
  3. // For conditions of distribution and use, see copyright notice in irrlicht.h
  4. #pragma once
  5. #include "IReferenceCounted.h"
  6. #include "irrArray.h"
  7. #include "EHardwareBufferFlags.h"
  8. #include "S3DVertex.h"
  9. namespace irr
  10. {
  11. namespace scene
  12. {
  13. class IVertexBuffer : public virtual IReferenceCounted
  14. {
  15. public:
  16. virtual void *getData() = 0;
  17. virtual video::E_VERTEX_TYPE getType() const = 0;
  18. virtual void setType(video::E_VERTEX_TYPE vertexType) = 0;
  19. virtual u32 stride() const = 0;
  20. virtual u32 size() const = 0;
  21. virtual void push_back(const video::S3DVertex &element) = 0;
  22. virtual video::S3DVertex &operator[](const u32 index) const = 0;
  23. virtual video::S3DVertex &getLast() = 0;
  24. virtual void set_used(u32 usedNow) = 0;
  25. virtual void reallocate(u32 new_size) = 0;
  26. virtual u32 allocated_size() const = 0;
  27. virtual video::S3DVertex *pointer() = 0;
  28. //! get the current hardware mapping hint
  29. virtual E_HARDWARE_MAPPING getHardwareMappingHint() const = 0;
  30. //! set the hardware mapping hint, for driver
  31. virtual void setHardwareMappingHint(E_HARDWARE_MAPPING NewMappingHint) = 0;
  32. //! flags the meshbuffer as changed, reloads hardware buffers
  33. virtual void setDirty() = 0;
  34. //! Get the currently used ID for identification of changes.
  35. /** This shouldn't be used for anything outside the VideoDriver. */
  36. virtual u32 getChangedID() const = 0;
  37. };
  38. } // end namespace scene
  39. } // end namespace irr