Source: core/sprites/webgl/BatchBuffer.js

core/sprites/webgl/BatchBuffer.js

  1. /**
  2. * @class
  3. * @memberof PIXI
  4. */
  5. export default class Buffer
  6. {
  7. /**
  8. * @param {number} size - The size of the buffer in bytes.
  9. */
  10. constructor(size)
  11. {
  12. this.vertices = new ArrayBuffer(size);
  13. /**
  14. * View on the vertices as a Float32Array for positions
  15. *
  16. * @member {Float32Array}
  17. */
  18. this.float32View = new Float32Array(this.vertices);
  19. /**
  20. * View on the vertices as a Uint32Array for uvs
  21. *
  22. * @member {Float32Array}
  23. */
  24. this.uint32View = new Uint32Array(this.vertices);
  25. }
  26. /**
  27. * Destroys the buffer.
  28. *
  29. */
  30. destroy()
  31. {
  32. this.vertices = null;
  33. this.positions = null;
  34. this.uvs = null;
  35. this.colors = null;
  36. }
  37. }