IVertexBuffer.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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 "EHardwareBufferFlags.h"
  7. #include "S3DVertex.h"
  8. namespace irr
  9. {
  10. namespace scene
  11. {
  12. class IVertexBuffer : public virtual IReferenceCounted
  13. {
  14. public:
  15. //! Get type of vertex data which is stored in this meshbuffer.
  16. /** \return Vertex type of this buffer. */
  17. virtual video::E_VERTEX_TYPE getType() const = 0;
  18. //! Get access to vertex data. The data is an array of vertices.
  19. /** Which vertex type is used can be determined by getVertexType().
  20. \return Pointer to array of vertices. */
  21. virtual const void *getData() const = 0;
  22. //! Get access to vertex data. The data is an array of vertices.
  23. /** Which vertex type is used can be determined by getVertexType().
  24. \return Pointer to array of vertices. */
  25. virtual void *getData() = 0;
  26. //! Get amount of vertices in meshbuffer.
  27. /** \return Number of vertices in this buffer. */
  28. virtual u32 getCount() const = 0;
  29. //! returns position of vertex i
  30. virtual const core::vector3df &getPosition(u32 i) const = 0;
  31. //! returns position of vertex i
  32. virtual core::vector3df &getPosition(u32 i) = 0;
  33. //! returns normal of vertex i
  34. virtual const core::vector3df &getNormal(u32 i) const = 0;
  35. //! returns normal of vertex i
  36. virtual core::vector3df &getNormal(u32 i) = 0;
  37. //! returns texture coord of vertex i
  38. virtual const core::vector2df &getTCoords(u32 i) const = 0;
  39. //! returns texture coord of vertex i
  40. virtual core::vector2df &getTCoords(u32 i) = 0;
  41. //! get the current hardware mapping hint
  42. virtual E_HARDWARE_MAPPING getHardwareMappingHint() const = 0;
  43. //! set the hardware mapping hint, for driver
  44. virtual void setHardwareMappingHint(E_HARDWARE_MAPPING newMappingHint) = 0;
  45. //! flags the meshbuffer as changed, reloads hardware buffers
  46. virtual void setDirty() = 0;
  47. //! Get the currently used ID for identification of changes.
  48. /** This shouldn't be used for anything outside the VideoDriver. */
  49. virtual u32 getChangedID() const = 0;
  50. //! Used by the VideoDriver to remember the buffer link.
  51. virtual void setHWBuffer(void *ptr) const = 0;
  52. virtual void *getHWBuffer() const = 0;
  53. };
  54. } // end namespace scene
  55. } // end namespace irr