newPool.lua 958 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. return {
  2. summary = 'Create a new Pool.',
  3. description = [[
  4. Creates a new `Pool`, used for allocating vector and matrix objects efficiently.
  5. Note that `lovr.math` has its own Pool that it uses when you call these functions:
  6. - `lovr.math.vec3`
  7. - `lovr.math.quat`
  8. - `lovr.math.mat4`
  9. So it's usually more convenient to use those functions. Pools are available to use if you have
  10. a need for more control over the memory used for your vectors.
  11. ]],
  12. arguments = {
  13. {
  14. name = 'size',
  15. type = 'number',
  16. description = 'The size of the Pool, in bytes.'
  17. },
  18. {
  19. name = 'resizable',
  20. type = 'boolean',
  21. default = 'false',
  22. description = 'Whether or not the Pool will resize itself.'
  23. }
  24. },
  25. returns = {
  26. {
  27. name = 'pool',
  28. type = 'Pool',
  29. description = 'The new Pool.'
  30. }
  31. },
  32. related = {
  33. 'lovr.math.vec3',
  34. 'lovr.math.quat',
  35. 'lovr.math.mat4'
  36. }
  37. }