2
0

hasUsage.lua 863 B

12345678910111213141516171819202122232425262728293031
  1. return {
  2. tag = 'texture-metadata',
  3. summary = 'Check if a Texture was created with a set of usage flags.',
  4. description = [[
  5. Returns whether a Texture was created with a set of `TextureUsage` flags. Usage flags are
  6. specified when the Texture is created, and restrict what you can do with a Texture object. By
  7. default, only the `sample` usage is enabled. Applying a smaller set of usage flags helps LÖVR
  8. optimize things better.
  9. ]],
  10. arguments = {
  11. ['...'] = {
  12. type = 'TextureUsage',
  13. description = 'One or more usage flags.'
  14. }
  15. },
  16. returns = {
  17. supported = {
  18. type = 'boolean',
  19. description = 'Whether the Texture has all the provided usage flags.'
  20. }
  21. },
  22. variants = {
  23. {
  24. arguments = { '...' },
  25. returns = { 'supported' }
  26. }
  27. },
  28. related = {
  29. 'lovr.graphics.newTexture'
  30. }
  31. }