Browse Source

Start v0.15.0 docs;

bjorn 4 years ago
parent
commit
7594fbfaf1
48 changed files with 810 additions and 1093 deletions
  1. 693 500
      api/init.lua
  2. 0 19
      api/lovr/audio/Source/getBitDepth.lua
  3. 0 19
      api/lovr/audio/Source/getChannelCount.lua
  4. 0 19
      api/lovr/audio/Source/getSampleRate.lua
  5. 0 19
      api/lovr/audio/Source/getType.lua
  6. 1 2
      api/lovr/audio/Source/tell.lua
  7. 0 21
      api/lovr/audio/SourceType.lua
  8. 2 14
      api/lovr/audio/newSource.lua
  9. 0 63
      api/lovr/data/AudioStream/append.lua
  10. 0 13
      api/lovr/data/AudioStream/decode.lua
  11. 0 19
      api/lovr/data/AudioStream/getBitDepth.lua
  12. 0 19
      api/lovr/data/AudioStream/getChannelCount.lua
  13. 0 16
      api/lovr/data/AudioStream/getDuration.lua
  14. 0 19
      api/lovr/data/AudioStream/getSampleRate.lua
  15. 0 11
      api/lovr/data/AudioStream/init.lua
  16. 1 1
      api/lovr/data/ModelData/init.lua
  17. 0 1
      api/lovr/data/SoundData/getBitDepth.lua
  18. 0 1
      api/lovr/data/SoundData/getChannelCount.lua
  19. 0 1
      api/lovr/data/SoundData/getDuration.lua
  20. 0 1
      api/lovr/data/SoundData/getSampleRate.lua
  21. 0 1
      api/lovr/data/SoundData/init.lua
  22. 9 12
      api/lovr/data/TextureData/encode.lua
  23. 0 70
      api/lovr/data/newAudioStream.lua
  24. 2 3
      api/lovr/data/newSoundData.lua
  25. 0 60
      api/lovr/enet/init.lua
  26. 1 14
      api/lovr/filesystem/getRequirePath.lua
  27. 1 15
      api/lovr/filesystem/setRequirePath.lua
  28. 1 1
      api/lovr/getVersion.lua
  29. 1 1
      api/lovr/graphics/Model/init.lua
  30. 4 1
      api/lovr/graphics/newModel.lua
  31. 0 43
      api/lovr/graphics/triangle.lua
  32. 5 3
      api/lovr/headset/renderTo.lua
  33. 3 12
      api/lovr/init.lua
  34. 0 17
      api/lovr/json/init.lua
  35. 1 1
      api/lovr/physics/Collider/getLinearDamping.lua
  36. 1 1
      api/lovr/physics/Collider/setLinearDamping.lua
  37. 1 1
      api/lovr/physics/World/getLinearDamping.lua
  38. 1 1
      api/lovr/physics/World/setLinearDamping.lua
  39. 16 0
      api/lovr/system/Permission.lua
  40. 15 0
      api/lovr/system/getCoreCount.lua
  41. 0 1
      api/lovr/system/getOS.lua
  42. 8 0
      api/lovr/system/init.lua
  43. 20 0
      api/lovr/system/requestPermission.lua
  44. 1 1
      api/lovr/thread/Channel/push.lua
  45. 1 0
      api/lovr/thread/Thread/init.lua
  46. 8 3
      api/lovr/thread/init.lua
  47. 4 13
      examples/Intro/Shapes/main.lua
  48. 9 40
      guides/Compiling.md

File diff suppressed because it is too large
+ 693 - 500
api/init.lua


+ 0 - 19
api/lovr/audio/Source/getBitDepth.lua

@@ -1,19 +0,0 @@
-return {
-  summary = 'Get the bit depth of the Source.',
-  description = [[
-    Returns the number of bits per sample in the Source.  This is a rough indicator of the
-    "resolution" or quality of the Source.  It's usually 16 or 32.
-  ]],
-  arguments = {},
-  returns = {
-    {
-      name = 'bits',
-      type = 'number',
-      description = 'The number of bits per sample.'
-    }
-  },
-  related = {
-    'SoundData:getBitDepth',
-    'AudioStream:getBitDepth'
-  }
-}

+ 0 - 19
api/lovr/audio/Source/getChannelCount.lua

@@ -1,19 +0,0 @@
-return {
-  summary = 'Get the number of channels in the Source.',
-  description = [[
-    Returns the number of channels in the Source.  Mono sounds have 1 channel and stereo sounds have
-    2 channels.
-  ]],
-  arguments = {},
-  returns = {
-    {
-      name = 'channels',
-      type = 'number',
-      description = 'The number of channels.'
-    }
-  },
-  related = {
-    'SoundData:getChannelCount',
-    'AudioStream:getChannelCount'
-  }
-}

+ 0 - 19
api/lovr/audio/Source/getSampleRate.lua

@@ -1,19 +0,0 @@
-return {
-  summary = 'Get the sample rate of the Source.',
-  description = [[
-    Returns the number of samples per second in the Source.  This is usually a high number like
-    44100.
-  ]],
-  arguments = {},
-  returns = {
-    {
-      name = 'frequency',
-      type = 'number',
-      description = 'The number of samples per second in the Source.'
-    }
-  },
-  related = {
-    'SoundData:getSampleRate',
-    'AudioStream:getSampleRate'
-  }
-}

+ 0 - 19
api/lovr/audio/Source/getType.lua

@@ -1,19 +0,0 @@
-return {
-  summary = 'Get the SourceType of the Source.',
-  description = [[
-    Returns the SourceType of the Source that controls how the Source decodes audio.  See
-    `SourceType` for more info.
-  ]],
-  arguments = {},
-  returns = {
-    {
-      name = 'type',
-      type = 'SourceType',
-      description = 'The SourceType of the Source.'
-    }
-  },
-  related = {
-    'SourceType',
-    'lovr.audio.newSource'
-  }
-}

+ 1 - 2
api/lovr/audio/Source/tell.lua

@@ -15,6 +15,5 @@ return {
       type = 'number',
       type = 'number',
       description = 'The current playback position.'
       description = 'The current playback position.'
     }
     }
-  },
-  notes = 'This function can not be used on a Source backed by a raw `AudioStream`.'
+  }
 }
 }

+ 0 - 21
api/lovr/audio/SourceType.lua

@@ -1,21 +0,0 @@
-return {
-  summary = 'Different ways to handle audio data for Source objects.',
-  description = [[
-    When you create a Source, you can either decode audio data gradually over time or you can decode
-    it all at once.  Streaming it over time will use less memory but cause higher processing
-    overhead because audio is continuously being decoded.  On the other hand, decoding a sound all
-    at once means it will take more time to load and use more memory, but after it's loaded there is
-    virtually no processing overhead.  It's recommended to use the 'static' mode for short sound
-    effects and the 'stream' mode for longer music tracks.
-  ]],
-  values = {
-    {
-      name = 'static',
-      description = 'Decode the entire sound file up front.'
-    },
-    {
-      name = 'stream',
-      description = 'Decode the sound gradually over time.'
-    }
-  }
-}

+ 2 - 14
api/lovr/audio/newSource.lua

@@ -11,17 +11,9 @@ return {
       type = 'Blob',
       type = 'Blob',
       description = 'The Blob containing the Source data.'
       description = 'The Blob containing the Source data.'
     },
     },
-    stream = {
-      type = 'AudioStream',
-      description = 'The AudioStream used to stream audio data to the Source.'
-    },
     soundData = {
     soundData = {
       type = 'SoundData',
       type = 'SoundData',
       description = 'The SoundData containing raw audio samples to play.'
       description = 'The SoundData containing raw audio samples to play.'
-    },
-    type = {
-      type = 'SourceType',
-      description = 'How to stream in audio data.'
     }
     }
   },
   },
   returns = {
   returns = {
@@ -32,15 +24,11 @@ return {
   },
   },
   variants = {
   variants = {
     {
     {
-      arguments = { 'filename', 'type' },
-      returns = { 'source' }
-    },
-    {
-      arguments = { 'blob', 'type' },
+      arguments = { 'filename' },
       returns = { 'source' }
       returns = { 'source' }
     },
     },
     {
     {
-      arguments = { 'stream', 'type' },
+      arguments = { 'blob' },
       returns = { 'source' }
       returns = { 'source' }
     },
     },
     {
     {

+ 0 - 63
api/lovr/data/AudioStream/append.lua

@@ -1,63 +0,0 @@
-return {
-  summary = 'Append raw PCM audio data to this audio stream for playback.',
-  description = [[
-    Append audio data that you have constructed yourself (perhaps by generating it in code, or
-    streaming it over the network).  Must only be called on a "raw" AudioStream (not one
-    constructed with a file or a blob).
-
-    The data must be 16-bit signed integer, and the sample rate and channel count must match the
-    values the AudioStream was constructed with.
-
-    If a call to `append` would make the internal buffer of this `AudioStream` to become bigger
-    than the `queueLimit` set on this AudioStream when it was constructed, that call to `append`
-    will ignore your blob and return false, queuing no data at all from that call.
-
-    After you've created a Source with your raw AudioStream, and appended enough audio data,
-    remember to call `Source:play` to make the `Source` start playing your queued data. If the
-    `Source` plays all the audio data you've queued and thus runs out of data to play, it will
-    automatically stop and you'll have to append more sound data and call `Source:play` again.
-    You can use `AudioStream:getDuration` to see how much data has been queued so far.
-
-    Try to have more audio queued than the time it will take before you call append() again to
-    avoid stuttery playback. Having more than 0.2s audio queued at all times is a good guideline.
-  ]],
-  arguments = {
-    blob = {
-      type = 'Blob',
-      description = [[
-        A Blob of sound bytes. Since it has no information about the format of the data,
-        `append` blindly trusts that you give it valid data.
-      ]]
-    },
-    soundData = {
-      type = 'SoundData',
-      description = [[
-        A SoundData blob of sound bytes.  The format of the `SoundData` must match the format
-        of the `AudioStream`.
-      ]]
-    }
-  },
-  returns = {
-    success = {
-      type = 'boolean',
-      description = [[
-        Whether this `append` did not exceed the queue limit, and data was thus appended to the
-        queue.
-      ]]
-    }
-  },
-  variants = {
-    {
-      arguments = { 'blob' },
-      returns = { 'success' }
-    },
-    {
-      arguments = { 'soundData' },
-      returns = { 'success' }
-    }
-  },
-  related = {
-    'lovr.data.newAudioStream',
-    'AudioStream:getDuration'
-  }
-}

+ 0 - 13
api/lovr/data/AudioStream/decode.lua

@@ -1,13 +0,0 @@
-return {
-  summary = 'Decode the next chunk of audio in the AudioStream.',
-  description = 'Returns a new SoundData containing the next chunk of audio in the AudioStream.',
-  arguments = {},
-  returns = {
-    {
-      name = 'soundData',
-      type = 'SoundData',
-      description = 'The SoundData object containing raw audio samples.'
-    }
-  },
-  notes = 'This function may return nil if there isn\'t any audio left in the stream.'
-}

+ 0 - 19
api/lovr/data/AudioStream/getBitDepth.lua

@@ -1,19 +0,0 @@
-return {
-  summary = 'Get the bit depth of the AudioStream.',
-  description = [[
-    Returns the number of bits per sample in the stream's sound data.  This is a rough indicator of
-    the "resolution" of the sound, and is usually 16.
-  ]],
-  arguments = {},
-  returns = {
-    {
-      name = 'bits',
-      type = 'number',
-      description = 'The number of bits per sample.'
-    }
-  },
-  related = {
-    'SoundData:getBitDepth',
-    'Source:getBitDepth'
-  }
-}

+ 0 - 19
api/lovr/data/AudioStream/getChannelCount.lua

@@ -1,19 +0,0 @@
-return {
-  summary = 'Get the number of channels in the AudioStream.',
-  description = [[
-    Returns the number of channels present in the stream's sound data.  Mono sounds have 1 channel
-    and stereo sounds have 2 channels.
-  ]],
-  arguments = {},
-  returns = {
-    {
-      name = 'channels',
-      type = 'number',
-      description = 'The number of channels.'
-    }
-  },
-  related = {
-    'SoundData:getChannelCount',
-    'Source:getChannelCount'
-  }
-}

+ 0 - 16
api/lovr/data/AudioStream/getDuration.lua

@@ -1,16 +0,0 @@
-return {
-  summary = 'Get the duration of the AudioStream.',
-  description = 'Returns the duration of the sound data in seconds.',
-  arguments = {},
-  returns = {
-    {
-      name = 'duration',
-      type = 'number',
-      description = 'The duration of the sound.'
-    }
-  },
-  related = {
-    'SoundData:getDuration',
-    'Source:getDuration'
-  }
-}

+ 0 - 19
api/lovr/data/AudioStream/getSampleRate.lua

@@ -1,19 +0,0 @@
-return {
-  summary = 'Get the sample rate of the AudioStream.',
-  description = [[
-    Returns the number of samples per second in the stream's sound data.  This is usually a high
-    number like 44100.
-  ]],
-  arguments = {},
-  returns = {
-    {
-      name = 'frequency',
-      type = 'number',
-      description = 'The number of samples per second in the AudioStream.'
-    }
-  },
-  related = {
-    'SoundData:getSampleRate',
-    'Source:getSampleRate'
-  }
-}

+ 0 - 11
api/lovr/data/AudioStream/init.lua

@@ -1,11 +0,0 @@
-return {
-  summary = 'An object that gradually decodes audio data.',
-  description = [[
-    An AudioStream is an object that reads and decodes compressed sound data.  All Source objects
-    are powered by AudioStreams.
-
-    Usually you can just use Sources without having to deal with AudioStreams, but sometimes you may
-    need low-level access to the audio stream.
-  ]],
-  constructor = 'lovr.data.newAudioStream'
-}

+ 1 - 1
api/lovr/data/ModelData/init.lua

@@ -5,7 +5,7 @@ return {
     can include a variety of things like the node structure of the asset, the vertex data it
     can include a variety of things like the node structure of the asset, the vertex data it
     contains, contains, the `TextureData` and `Material` properties, and any included animations.
     contains, contains, the `TextureData` and `Material` properties, and any included animations.
 
 
-    The current supported formats are OBJ and glTF.
+    The current supported formats are OBJ, glTF, and STL.
 
 
     Usually you can just load a `Model` directly, but using a `ModelData` can be helpful if you want
     Usually you can just load a `Model` directly, but using a `ModelData` can be helpful if you want
     to load models in a thread or access more low-level information about the Model.
     to load models in a thread or access more low-level information about the Model.

+ 0 - 1
api/lovr/data/SoundData/getBitDepth.lua

@@ -13,7 +13,6 @@ return {
     }
     }
   },
   },
   related = {
   related = {
-    'AudioStream:getBitDepth',
     'Source:getBitDepth'
     'Source:getBitDepth'
   }
   }
 }
 }

+ 0 - 1
api/lovr/data/SoundData/getChannelCount.lua

@@ -21,7 +21,6 @@ return {
     number 5, since samples start at zero and `(sample * channelCount) + channelIndex = 5`.
     number 5, since samples start at zero and `(sample * channelCount) + channelIndex = 5`.
   ]],
   ]],
   related = {
   related = {
-    'AudioStream:getChannelCount',
     'Source:getChannelCount'
     'Source:getChannelCount'
   }
   }
 }
 }

+ 0 - 1
api/lovr/data/SoundData/getDuration.lua

@@ -11,7 +11,6 @@ return {
   },
   },
   related = {
   related = {
     'SoundData:getSampleCount',
     'SoundData:getSampleCount',
-    'AudioStream:getDuration',
     'Source:getDuration'
     'Source:getDuration'
   }
   }
 }
 }

+ 0 - 1
api/lovr/data/SoundData/getSampleRate.lua

@@ -13,7 +13,6 @@ return {
     }
     }
   },
   },
   related = {
   related = {
-    'AudioStream:getSampleRate',
     'Source:getSampleRate'
     'Source:getSampleRate'
   }
   }
 }
 }

+ 0 - 1
api/lovr/data/SoundData/init.lua

@@ -6,7 +6,6 @@ return {
   ]],
   ]],
   constructors = {
   constructors = {
     'lovr.data.newSoundData',
     'lovr.data.newSoundData',
-    'AudioStream:decode',
     'Microphone:getData'
     'Microphone:getData'
   }
   }
 }
 }

+ 9 - 12
api/lovr/data/TextureData/encode.lua

@@ -1,18 +1,15 @@
 return {
 return {
-  summary = 'Encode the TextureData as png and write it to a file.',
-  description = 'Encodes the TextureData to png and writes it to the specified file.',
-  arguments = {
-    {
-      name = 'filename',
-      type = 'string',
-      description = 'The file to write the png data to.'
-    }
-  },
+  summary = 'Encode the TextureData as png.',
+  description = 'Encodes the TextureData to a png.',
+  arguments = {},
   returns = {
   returns = {
     {
     {
-      name = 'success',
-      type = 'boolean',
-      description = 'Whether or not the file was successfully written to.'
+      name = 'blob',
+      type = 'Blob',
+      description = 'A new Blob containing the PNG image data.'
     }
     }
+  },
+  related = {
+    'lovr.filesystem.write'
   }
   }
 }
 }

+ 0 - 70
api/lovr/data/newAudioStream.lua

@@ -1,70 +0,0 @@
-return {
-  summary = 'Create a new AudioStream.',
-  description = [[
-    Creates a new AudioStream. AudioStream has two modes:
-
-    - Constructed with a filename or blob, AudioStream will decode the given file on demand. Right
-      now, the only supported audio format is Ogg Vorbis (.ogg).
-    - Constructed without, it's a "raw" audiostream that you append data to in real-time. See
-      `AudioStream:append` for usage.
-  ]],
-  arguments = {
-    filename = {
-      type = 'string',
-      description = 'The filename of the audio file to load.'
-    },
-    blob = {
-      type = 'Blob',
-      description = 'The Blob containing audio data to decode.'
-    },
-    sampleRate = {
-      type = 'number',
-      description = [[
-        The resolution of the stream, in samples per second (examples of common values: 44100,
-        48000, 16000).
-      ]]
-    },
-    bufferSize = {
-      type = 'number',
-      default = '4096',
-      description = 'The size of the stream\'s audio buffer, in samples.'
-    },
-    queueLimit = {
-      type = 'number',
-      default = 'sampleRate * 0.5',
-      description = [[
-        The maximum number of audio samples that this AudioStream will queue. The default is half a
-        second worth of data. Set to 0 for no limit (but be careful not to use too much RAM).
-      ]]
-    },
-    channelCount = {
-      type = 'number',
-      description = 'Number of audio channels (1 for mono or 2 for stereo).'
-    }
-  },
-  returns = {
-    audioStream = {
-      type = 'AudioStream',
-      description = 'The new AudioStream.'
-    }
-  },
-  variants = {
-    {
-      description = 'Create an `AudioStream` decoding ogg audio from the file at `filename`.',
-      arguments = { 'filename', 'bufferSize' },
-      returns = { 'audioStream' }
-    },
-    {
-      description = 'Create an `AudioStream` decoding ogg audio from the given Blob.',
-      arguments = { 'blob', 'bufferSize' },
-      returns = { 'audioStream' }
-    },
-    {
-      description = [[
-        Create a raw `AudioStream`.  You must call `append` to give it audio to stream later.
-      ]],
-      arguments = { 'channelCount', 'sampleRate', 'bufferSize', 'queueLimit'},
-      returns = { 'audioStream' }
-    }
-  }
-}

+ 2 - 3
api/lovr/data/newSoundData.lua

@@ -1,9 +1,8 @@
 return {
 return {
   summary = 'Create a new SoundData.',
   summary = 'Create a new SoundData.',
   description = [[
   description = [[
-    Creates a new SoundData.  You can pass a filename or Blob to decode, an existing AudioStream to
-    decode audio samples from, or you can create an empty SoundData that can hold a certain number
-    of samples.
+    Creates a new SoundData.  You can pass a filename or Blob to decode or you can create an empty
+    SoundData that can hold a certain number of samples.
   ]],
   ]],
   arguments = {
   arguments = {
     samples = {
     samples = {

+ 0 - 60
api/lovr/enet/init.lua

@@ -1,60 +0,0 @@
-return {
-  tag = 'library',
-  summary = 'Multiplayer utilities.',
-  description = [[
-    ENet is a UDP networking library bundled with LÖVR that allows you to create multiplayer
-    experiences.
-
-    To use it, `require` the `enet` module.
-
-    More information, including full documentation and examples can be found on the
-    [lua-enet](http://leafo.net/lua-enet/) page.
-  ]],
-  external = true,
-  example = {
-    description = [[
-      Here's a simple echo server example. The client sends a message to the server and waits for a
-      response. The server waits for a message and sends it back to the client.
-    ]],
-    code = [[
-      -- client/main.lua
-      local enet = require 'enet'
-
-      function lovr.load()
-        local host = enet.host_create()
-        local server = host:connect('localhost:6789')
-
-        local done = false
-        while not done do
-          local event = host:service(100)
-          if event then
-            if event.type == 'connect' then
-              print('Connected to', event.peer)
-              event.peer:send('hello world')
-            elseif event.type == 'receive' then
-              print('Got message: ', event.data, event.peer)
-              done = true
-            end
-          end
-        end
-
-        server:disconnect()
-        host:flush()
-      end
-
-      -- server/main.lua
-      local enet = require 'enet'
-
-      function lovr.load()
-        local host = enet.host_create('localhost:6789')
-        while true do
-          local event = host:service(100)
-          if event and event.type == 'receive' then
-            print('Got message: ', event.data, event.peer)
-            event.peer:send(event.data)
-          end
-        end
-      end
-    ]]
-  }
-}

+ 1 - 14
api/lovr/filesystem/getRequirePath.lua

@@ -5,11 +5,6 @@ return {
     will use to search for files when they are `require`d.  Any question marks in the pattern will
     will use to search for files when they are `require`d.  Any question marks in the pattern will
     be replaced with the module that is being required.  It is similar to Lua\'s `package.path`
     be replaced with the module that is being required.  It is similar to Lua\'s `package.path`
     variable, but the main difference is that the patterns are relative to the virtual filesystem.
     variable, but the main difference is that the patterns are relative to the virtual filesystem.
-
-    For the C require path, double question marks will be replaced by the name of the module with
-    the operating system's native extension for shared libraries.  For example, if you do
-    `require('lib')` and the C require path is `??`, LÖVR will try to load `lib.dll` if you're on
-    Windows or `lib.so` if you're on Linux.
   ]],
   ]],
   arguments = {},
   arguments = {},
   returns = {
   returns = {
@@ -17,15 +12,7 @@ return {
       name = 'path',
       name = 'path',
       type = 'string',
       type = 'string',
       description = 'The semicolon separated list of search patterns.'
       description = 'The semicolon separated list of search patterns.'
-    },
-    {
-      name = 'cpath',
-      type = 'string',
-      description = 'The semicolon separated list of search patterns for C libraries.'
     }
     }
   },
   },
-  notes = [[
-    The default reqiure path is '?.lua;?/init.lua;lua_modules/?.lua;lua_modules/?/init.lua'.  The
-    default C require path is '??'.
-  ]]
+  notes = ' The default reqiure path is \'?.lua;?/init.lua\'.'
 }
 }

+ 1 - 15
api/lovr/filesystem/setRequirePath.lua

@@ -6,11 +6,6 @@ return {
     be replaced with the module that is being required.  It is similar to Lua\'s `package.path`
     be replaced with the module that is being required.  It is similar to Lua\'s `package.path`
     variable, but the main difference is that the patterns are relative to the save directory and
     variable, but the main difference is that the patterns are relative to the save directory and
     the project directory.
     the project directory.
-
-    For the C require path, double question marks will be replaced by the name of the module with
-    the operating system's native extension for shared libraries.  For example, if you do
-    `require('lib')` and the C require path is `??`, LÖVR will try to load `lib.dll` if you're on
-    Windows or `lib.so` if you're on Linux.
   ]],
   ]],
   arguments = {
   arguments = {
     {
     {
@@ -18,17 +13,8 @@ return {
       type = 'string',
       type = 'string',
       default = 'nil',
       default = 'nil',
       description = 'An optional semicolon separated list of search patterns.'
       description = 'An optional semicolon separated list of search patterns.'
-    },
-    {
-      name = 'cpath',
-      type = 'string',
-      default = 'nil',
-      description = 'An optional semicolon separated list of search patterns for C libraries.'
     }
     }
   },
   },
   returns = {},
   returns = {},
-  notes = [[
-    The default reqiure path is '?.lua;?/init.lua;lua_modules/?.lua;lua_modules/?/init.lua'.  The
-    default C require path is '??'.
-  ]]
+  notes = 'The default reqiure path is \'?.lua;?/init.lua\'.'
 }
 }

+ 1 - 1
api/lovr/getVersion.lua

@@ -1,5 +1,5 @@
 return {
 return {
-  tag = 'system',
+  tag = 'version',
   summary = 'Get the current version.',
   summary = 'Get the current version.',
   description = 'Get the current major, minor, and patch version of LÖVR.',
   description = 'Get the current major, minor, and patch version of LÖVR.',
   arguments = {},
   arguments = {},

+ 1 - 1
api/lovr/graphics/Model/init.lua

@@ -2,7 +2,7 @@ return {
   summary = 'An asset imported from a 3D model file.',
   summary = 'An asset imported from a 3D model file.',
   description = [[
   description = [[
     A Model is a drawable object loaded from a 3D file format.  The supported 3D file formats are
     A Model is a drawable object loaded from a 3D file format.  The supported 3D file formats are
-    OBJ and glTF.
+    OBJ, glTF, and STL.
   ]],
   ]],
   constructors = {
   constructors = {
     'lovr.graphics.newModel',
     'lovr.graphics.newModel',

+ 4 - 1
api/lovr/graphics/newModel.lua

@@ -1,7 +1,9 @@
 return {
 return {
   tag = 'graphicsObjects',
   tag = 'graphicsObjects',
   summary = 'Create a new Model.',
   summary = 'Create a new Model.',
-  description = 'Creates a new Model from a file.  The supported 3D file formats are OBJ and glTF.',
+  description = [[
+    Creates a new Model from a file.  The supported 3D file formats are OBJ, glTF, and STL.
+  ]],
   arguments = {
   arguments = {
     filename = {
     filename = {
       type = 'string',
       type = 'string',
@@ -40,5 +42,6 @@ return {
     - glTF: base64 images are not supported (base64 buffer data works though).
     - glTF: base64 images are not supported (base64 buffer data works though).
     - glTF: Only the default scene is loaded.
     - glTF: Only the default scene is loaded.
     - glTF: Currently, each skin in a Model can have up to 48 joints.
     - glTF: Currently, each skin in a Model can have up to 48 joints.
+    - STL: ASCII STL files are not supported.
   ]]
   ]]
 }
 }

+ 0 - 43
api/lovr/graphics/triangle.lua

@@ -1,43 +0,0 @@
-return {
-  tag = 'graphicsPrimitives',
-  summary = 'Draw triangles.',
-  description = 'Draws triangles from a list of points.',
-  arguments = {
-    mode = {
-      type = 'DrawStyle',
-      description = 'How to draw the triangle.'
-    },
-    material = {
-      type = 'Material',
-      description = 'The Material to apply.'
-    },
-    x = {
-      type = 'number',
-      description = 'The x coordinate of a vertex.'
-    },
-    y = {
-      type = 'number',
-      description = 'The y coordinate of a vertex.'
-    },
-    z = {
-      type = 'number',
-      description = 'The z coordinate of a vertex.'
-    },
-    ['...'] = {
-      type = 'number',
-      description = 'More vertices.'
-    }
-  },
-  returns = {},
-  variants = {
-    {
-      arguments = { 'mode', 'x', 'y', 'z', '...' },
-      returns = {}
-    },
-    {
-      arguments = { 'material', 'x', 'y', 'z', '...' },
-      returns = {}
-    }
-  },
-  notes = 'The number of vertices must be a multiple of three.'
-}

+ 5 - 3
api/lovr/headset/renderTo.lua

@@ -25,8 +25,10 @@ return {
   },
   },
   returns = {},
   returns = {},
   notes = [[
   notes = [[
-    On the `web` and `android` platforms (see `lovr.getOS`), headset rendering is asynchronous and
-    the callback passed to `lovr.headset.renderTo` will not be called immediately.  This is due to
-    certain restrictions inherent to these platforms.
+    When using the `pico` headset driver, headset rendering is asynchronous and the callback passed
+    to `lovr.headset.renderTo` will not be called immediately.
+
+    If the callback is `nil`, an empty frame cleared to current graphics background color will be
+    submitted to the headset.
   ]]
   ]]
 }
 }

+ 3 - 12
api/lovr/init.lua

@@ -26,18 +26,9 @@ return {
       ]]
       ]]
     },
     },
     {
     {
-      name = 'System',
-      tag = 'system',
-      description = [[
-        The lovr module also exposes some functions for retrieving information about the system.
-      ]]
-    },
-    {
-      name = 'Libraries',
-      tag = 'library',
-      description = [[
-        A few helpful third-party libraries are included with LÖVR for convenience.
-      ]]
+      name = 'Version',
+      tag = 'version',
+      description = 'This function can be used to get the current version of LÖVR.'
     }
     }
   }
   }
 }
 }

+ 0 - 17
api/lovr/json/init.lua

@@ -1,17 +0,0 @@
-return {
-  tag = 'library',
-  summary = 'Encodes and decodes JSON.',
-  description = [[
-    The json module exposes functions for encoding and decoding JSON. You can use it by requiring
-    the `cjson` module.
-  ]],
-  external = true,
-  example = [[
-    local json = require 'cjson'
-    local data = { health = 10, position = { 1, 2, 3 } }
-    local encoded = json.encode(data)
-    print(encoded)
-    local decoded = json.decode(encoded)
-    print(decoded.health, unpack(decoded.position))
-  ]]
-}

+ 1 - 1
api/lovr/physics/Collider/getLinearDamping.lua

@@ -18,7 +18,7 @@ return {
     }
     }
   },
   },
   notes = [[
   notes = [[
-    A linear damping of 0 means the Collider won't slow down over time.
+    A linear damping of 0 means the Collider won't slow down over time.  This is the default.
 
 
     Linear damping can also be set on the World using `World:setLinearDamping`, which will affect
     Linear damping can also be set on the World using `World:setLinearDamping`, which will affect
     all new colliders.
     all new colliders.

+ 1 - 1
api/lovr/physics/Collider/setLinearDamping.lua

@@ -20,7 +20,7 @@ return {
   },
   },
   returns = {},
   returns = {},
   notes = [[
   notes = [[
-    A linear damping of 0 means the Collider won't slow down over time.
+    A linear damping of 0 means the Collider won't slow down over time.  This is the default.
 
 
     Linear damping can also be set on the World using `World:setLinearDamping`, which will affect
     Linear damping can also be set on the World using `World:setLinearDamping`, which will affect
     all new colliders.
     all new colliders.

+ 1 - 1
api/lovr/physics/World/getLinearDamping.lua

@@ -19,7 +19,7 @@ return {
     }
     }
   },
   },
   notes = [[
   notes = [[
-    A linear damping of 0 means colliders won't slow down over time.
+    A linear damping of 0 means colliders won't slow down over time.  This is the default.
 
 
     Linear damping can also be set on individual colliders.
     Linear damping can also be set on individual colliders.
   ]],
   ]],

+ 1 - 1
api/lovr/physics/World/setLinearDamping.lua

@@ -21,7 +21,7 @@ return {
   },
   },
   returns = {},
   returns = {},
   notes = [[
   notes = [[
-    A linear damping of 0 means colliders won't slow down over time.
+    A linear damping of 0 means colliders won't slow down over time.  This is the default.
 
 
     Linear damping can also be set on individual colliders.
     Linear damping can also be set on individual colliders.
   ]],
   ]],

+ 16 - 0
api/lovr/system/Permission.lua

@@ -0,0 +1,16 @@
+return {
+  summary = 'Application permissions.',
+  description = [[
+    These are the different permissions that need to be requested using
+    `lovr.system.requestPermission` on some platforms.
+  ]],
+  values = {
+    {
+      name = 'audiocapture',
+      description = 'Requests microphone access.'
+    }
+  },
+  related = {
+    'lovr.system.requestPermission'
+  }
+}

+ 15 - 0
api/lovr/system/getCoreCount.lua

@@ -0,0 +1,15 @@
+return {
+  summary = 'Get the number of logical cores.',
+  description = 'Returns the number of logical cores on the system.',
+  arguments = {},
+  returns = {
+    {
+      name = 'cores',
+      type = 'number',
+      description = 'The number of logical cores on the system.'
+    }
+  },
+  related = {
+    'lovr.thread'
+  }
+}

+ 0 - 1
api/lovr/getOS.lua → api/lovr/system/getOS.lua

@@ -1,5 +1,4 @@
 return {
 return {
-  tag = 'system',
   summary = 'Get the current operating system.',
   summary = 'Get the current operating system.',
   description = 'Returns the current operating system.',
   description = 'Returns the current operating system.',
   arguments = {},
   arguments = {},

+ 8 - 0
api/lovr/system/init.lua

@@ -0,0 +1,8 @@
+return {
+  tag = 'modules',
+  summary = 'Provides information about the current operating system and platform.',
+  description = [[
+    The `lovr.system` provides information about the current operating system, and platform, and
+    hardware.
+  ]]
+}

+ 20 - 0
api/lovr/system/requestPermission.lua

@@ -0,0 +1,20 @@
+return {
+  summary = 'Request permission to use a feature.',
+  description = [[
+    Requests permission to use a feature.  Usually this will pop up a dialog box that the user needs
+    to confirm.  Once the permission request has been acknowledged, the `lovr.permission` callback
+    will be called with the result.  Currently, this is only used for requesting microphone access
+    on Android devices.
+  ]],
+  arguments = {
+    {
+      name = 'permission',
+      type = 'Permission',
+      description = 'The permission to request.'
+    }
+  },
+  returns = {},
+  related = {
+    'lovr.permission'
+  }
+}

+ 1 - 1
api/lovr/thread/Channel/push.lua

@@ -2,7 +2,7 @@ return {
   summary = 'Push a message onto the Channel.',
   summary = 'Push a message onto the Channel.',
   description = [[
   description = [[
     Pushes a message onto the Channel.  The following types of data can be pushed: nil, boolean,
     Pushes a message onto the Channel.  The following types of data can be pushed: nil, boolean,
-    number, string, and userdata.  Simple tables can be serialized to JSON using the `json` module.
+    number, string, and userdata.  Tables should be serialized to strings.
   ]],
   ]],
   arguments = {
   arguments = {
     {
     {

+ 1 - 0
api/lovr/thread/Thread/init.lua

@@ -9,6 +9,7 @@ return {
   constructor = 'lovr.thread.newThread',
   constructor = 'lovr.thread.newThread',
   related = {
   related = {
     'lovr.threaderror',
     'lovr.threaderror',
+    'lovr.system.getCoreCount',
     'Channel'
     'Channel'
   }
   }
 }
 }

+ 8 - 3
api/lovr/thread/init.lua

@@ -1,6 +1,6 @@
 return {
 return {
   tag = 'modules',
   tag = 'modules',
-  summary = 'Allows you to work with background threads.',
+  summary = 'Allows the creation of background threads.',
   description = [[
   description = [[
     The `lovr.thread` module provides functions for creating threads and communicating between them.
     The `lovr.thread` module provides functions for creating threads and communicating between them.
 
 
@@ -10,8 +10,10 @@ return {
     framerate or performance of the main thread.  Some examples of this include asset loading,
     framerate or performance of the main thread.  Some examples of this include asset loading,
     networking and network requests, and physics simulation.
     networking and network requests, and physics simulation.
 
 
-    Threads come with some limitations though.
+    Threads come with some caveats:
 
 
+    - Threads run in a bare Lua environment.  The `lovr` module (and any of lovr's modules) need to
+      be required before they can be used.
     - Threads are completely isolated from other threads.  They do not have access to the variables
     - Threads are completely isolated from other threads.  They do not have access to the variables
       or functions of other threads, and communication between threads must be coordinated through
       or functions of other threads, and communication between threads must be coordinated through
       `Channel` objects.
       `Channel` objects.
@@ -21,5 +23,8 @@ return {
     - `lovr.event.pump` cannot be called from a thread.
     - `lovr.event.pump` cannot be called from a thread.
     - Crashes or problems can happen if two threads access the same object at the same time, so
     - Crashes or problems can happen if two threads access the same object at the same time, so
       special care must be taken to coordinate access to objects from multiple threads.
       special care must be taken to coordinate access to objects from multiple threads.
-  ]]
+  ]],
+  related = {
+    'lovr.system.getCoreCount'
+  }
 }
 }

+ 4 - 13
examples/Intro/Shapes/main.lua

@@ -13,13 +13,13 @@ function lovr.draw()
   local x, y, z
   local x, y, z
 
 
   -- Point
   -- Point
-  x, y, z = -.6, 1.1, -1
+  x, y, z = -.3, 1.1, -1
   lovr.graphics.setPointSize(5)
   lovr.graphics.setPointSize(5)
   lovr.graphics.setColor(1, 1, 1)
   lovr.graphics.setColor(1, 1, 1)
   lovr.graphics.points(x, y, z)
   lovr.graphics.points(x, y, z)
 
 
   -- Line
   -- Line
-  x, y, z = 0, 1.1, -1
+  x, y, z = .3, 1.1, -1
   local points = {
   local points = {
     x - .1, y, z,
     x - .1, y, z,
     x + .1, y, z
     x + .1, y, z
@@ -27,14 +27,6 @@ function lovr.draw()
   lovr.graphics.setColor(1, 1, 1)
   lovr.graphics.setColor(1, 1, 1)
   lovr.graphics.line(points)
   lovr.graphics.line(points)
 
 
-  -- Triangle
-  local x, y, z = .6, 1.1, -1
-  local p1 = { x, y + .2, z }
-  local p2 = { x - .2, y - .2, z }
-  local p3 = { x + .2, y - .2, z }
-  lovr.graphics.setColor(.36, .41, .75)
-  lovr.graphics.triangle('fill', p1[1], p1[2], p1[3], p2[1], p2[2], p2[3], p3[1], p3[2], p3[3])
-
   -- Plane
   -- Plane
   local x, y, z = -.6, 1.7, -1.5
   local x, y, z = -.6, 1.7, -1.5
   lovr.graphics.setColor(.94, .33, .31)
   lovr.graphics.setColor(.94, .33, .31)
@@ -66,9 +58,8 @@ function lovr.draw()
   lovr.graphics.sphere(x, y, z, .2)
   lovr.graphics.sphere(x, y, z, .2)
 
 
   lovr.graphics.setShader()
   lovr.graphics.setShader()
-  drawLabel('Point', -.6, 1.4, -1)
-  drawLabel('Line', 0, 1.4, -1)
-  drawLabel('Triangle', .6, 1.4, -1)
+  drawLabel('Point', -.3, 1.4, -1)
+  drawLabel('Line', .3, 1.4, -1)
   drawLabel('Plane', -.6, 2.0, -1.5)
   drawLabel('Plane', -.6, 2.0, -1.5)
   drawLabel('Cube', 0, 2.0, -1.5)
   drawLabel('Cube', 0, 2.0, -1.5)
   drawLabel('Box', .6, 2.0, -1.5)
   drawLabel('Box', .6, 2.0, -1.5)

+ 9 - 40
guides/Compiling.md

@@ -8,20 +8,16 @@ and compiling the code on various types of systems.
 Dependencies
 Dependencies
 ---
 ---
 
 
-LÖVR depends on the following libraries.  They are included as submodules in the `deps` directory of
-the repository, so make sure you clone with the `--recursive` flag or run `git submodule update
---init` in an existing repository.
+LÖVR uses the following libraries.  They are included as submodules in the `deps` directory of the
+repository, so make sure you clone with the `--recursive` flag or run `git submodule update --init`
+in an existing repository.
 
 
-- Lua (5.1+) or LuaJIT (2.0+)
-- GLFW (3.2+)
+- Lua (5.1+) or LuaJIT (2.1+)
+- GLFW (3.3+)
 - OpenGL (3.3, ES3, or WebGL 2)
 - OpenGL (3.3, ES3, or WebGL 2)
-- OpenVR (1.0.9, for `lovr.headset`)
-- Oculus SDK (optional, 1.26+)
-- PhysicsFS (3+)
-- OpenAL (1.17+ recommended for HRTF support)
+- OpenVR
 - msdfgen
 - msdfgen
-- ODE (for `lovr.physics`)
-- Emscripten (optional, for compiling for web)
+- ODE
 
 
 Windows
 Windows
 ---
 ---
@@ -43,13 +39,7 @@ via the command line as `lovr.exe path/to/project`.
 macOS
 macOS
 ---
 ---
 
 
-Install the dependencies using your package manager of choice:
-
-```
-$ brew install glfw3 luajit physfs openal-soft ode libccd
-```
-
-Next, build using CMake, as above:
+Build using CMake, as above:
 
 
 ```
 ```
 $ mkdir build
 $ mkdir build
@@ -66,27 +56,10 @@ you can run a project like this:
 $ lovr /path/to/myGame
 $ lovr /path/to/myGame
 ```
 ```
 
 
-> You may need to set the `PKG_CONFIG_PATH` environment variable for OpenAL to be located properly.
-> If you run into this, see [Troubleshooting](#troubleshooting) below for more info.
-
 Linux
 Linux
 ---
 ---
 
 
-First, install the dependencies using your package manager of choice.
-
-#### Arch Linux
-
-```
-$ pacman -S glfw-x11 luajit physfs openal ode
-```
-
-#### Debian/Ubuntu
-
-```
-$ sudo apt install build-essential cmake xorg-dev libglfw3-dev libluajit-5.1-dev libphysfs-dev libopenal-dev libode-dev libccd-dev libenet-dev
-```
-
-Then, build with CMake:
+Install a C compiler and CMake, then run:
 
 
 ```
 ```
 $ mkdir build
 $ mkdir build
@@ -308,7 +281,3 @@ Troubleshooting
 - If you get "CMake no CMAKE_CXX_COMPILER found" on Windows, then install Visual Studio and create a
 - If you get "CMake no CMAKE_CXX_COMPILER found" on Windows, then install Visual Studio and create a
   blank C++ project, which will prompt you to install the compilers and tools necessary to compile
   blank C++ project, which will prompt you to install the compilers and tools necessary to compile
   LÖVR.
   LÖVR.
-- On macOS, if you run into an error message about not being able to find OpenAL, make sure you've
-  added the proper OpenAL directory (usually something like
-  `/usr/local/opt/openal-soft/lib/pkgconfig`) to your `PKG_CONFIG_PATH` environment variable.
-  Installing openal-soft with brew will print out a message telling you how to do this.

Some files were not shown because too many files changed in this diff