IIndexBuffer.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 "SVertexIndex.h"
  9. namespace irr
  10. {
  11. namespace video
  12. {
  13. }
  14. namespace scene
  15. {
  16. class IIndexBuffer : public virtual IReferenceCounted
  17. {
  18. public:
  19. virtual void *getData() = 0;
  20. virtual video::E_INDEX_TYPE getType() const = 0;
  21. virtual void setType(video::E_INDEX_TYPE IndexType) = 0;
  22. virtual u32 stride() const = 0;
  23. virtual u32 size() const = 0;
  24. virtual void push_back(const u32 &element) = 0;
  25. virtual u32 operator[](u32 index) const = 0;
  26. virtual u32 getLast() = 0;
  27. virtual void setValue(u32 index, u32 value) = 0;
  28. virtual void set_used(u32 usedNow) = 0;
  29. virtual void reallocate(u32 new_size) = 0;
  30. virtual u32 allocated_size() const = 0;
  31. virtual void *pointer() = 0;
  32. //! get the current hardware mapping hint
  33. virtual E_HARDWARE_MAPPING getHardwareMappingHint() const = 0;
  34. //! set the hardware mapping hint, for driver
  35. virtual void setHardwareMappingHint(E_HARDWARE_MAPPING NewMappingHint) = 0;
  36. //! flags the meshbuffer as changed, reloads hardware buffers
  37. virtual void setDirty() = 0;
  38. //! Get the currently used ID for identification of changes.
  39. /** This shouldn't be used for anything outside the VideoDriver. */
  40. virtual u32 getChangedID() const = 0;
  41. };
  42. } // end namespace scene
  43. } // end namespace irr