|
@@ -6394,11 +6394,6 @@ return {
|
|
name = "name",
|
|
name = "name",
|
|
type = "string",
|
|
type = "string",
|
|
description = "The name of the event."
|
|
description = "The name of the event."
|
|
- },
|
|
|
|
- {
|
|
|
|
- name = "...",
|
|
|
|
- type = "*",
|
|
|
|
- description = "The arguments for the event. Currently, up to 4 are supported."
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
returns = {}
|
|
returns = {}
|
|
@@ -12210,7 +12205,7 @@ return {
|
|
arguments = {
|
|
arguments = {
|
|
{
|
|
{
|
|
name = "shader",
|
|
name = "shader",
|
|
- type = "boolean",
|
|
|
|
|
|
+ type = "Shader",
|
|
description = "A custom Shader object to use for rendering."
|
|
description = "A custom Shader object to use for rendering."
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -14613,11 +14608,6 @@ return {
|
|
name = "format",
|
|
name = "format",
|
|
type = "TextureFormat",
|
|
type = "TextureFormat",
|
|
description = "TODO"
|
|
description = "TODO"
|
|
- },
|
|
|
|
- {
|
|
|
|
- name = "...features",
|
|
|
|
- type = "TextureFeature",
|
|
|
|
- description = "TODO"
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
returns = {
|
|
returns = {
|
|
@@ -16342,13 +16332,7 @@ return {
|
|
description = "The axis."
|
|
description = "The axis."
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- returns = {
|
|
|
|
- {
|
|
|
|
- name = "...",
|
|
|
|
- type = "number",
|
|
|
|
- description = "The current state of the components of the axis, or `nil` if the device does not have any information about the axis."
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ returns = {}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -16592,11 +16576,6 @@ return {
|
|
description = "Returns 2D triangle vertices that represent areas of the headset display that will never be seen by the user (due to the circular lenses). This area can be masked out by rendering it to the depth buffer or stencil buffer. Then, further drawing operations can skip rendering those pixels using the depth test (`lovr.graphics.setDepthTest`) or stencil test (`lovr.graphics.setStencilTest`), which improves performance.",
|
|
description = "Returns 2D triangle vertices that represent areas of the headset display that will never be seen by the user (due to the circular lenses). This area can be masked out by rendering it to the depth buffer or stencil buffer. Then, further drawing operations can skip rendering those pixels using the depth test (`lovr.graphics.setDepthTest`) or stencil test (`lovr.graphics.setStencilTest`), which improves performance.",
|
|
key = "lovr.headset.getDisplayMask",
|
|
key = "lovr.headset.getDisplayMask",
|
|
module = "lovr.headset",
|
|
module = "lovr.headset",
|
|
- examples = {
|
|
|
|
- {
|
|
|
|
- code = "function lovr.load()\n lovr.graphics.setBackgroundColor(1, 1, 1)\n\n shader = lovr.graphics.newShader([[\n vec4 position(mat4 projection, mat4 transform, vec4 vertex) {\n\n // Rescale mesh coordinates from (0,1) to (-1,1)\n vertex.xy *= 2.;\n vertex.xy -= 1.;\n\n // Flip the mesh if it's being drawn in the right eye\n if (lovrViewID == 1) {\n vertex.x = -vertex.x;\n }\n\n return vertex;\n }\n ]], [[\n // The fragment shader returns solid black for illustration purposes. It could be transparent.\n vec4 color(vec4 graphicsColor, sampler2D image, vec2 uv) {\n return vec4(0., 0., 0., 1.);\n }\n ]])\n\n mask = lovr.headset.getDisplayMask()\n\n if mask then\n mesh = lovr.graphics.newMesh({ { 'lovrPosition', 'float', 2 } }, mask, 'triangles')\n end\nend\n\nfunction lovr.draw()\n if mask then\n -- Mask out parts of the display that aren't visible to skip rendering those pixels later\n lovr.graphics.setShader(shader)\n mesh:draw()\n lovr.graphics.setShader()\n\n -- Draw a red cube\n lovr.graphics.setColor(0xff0000)\n lovr.graphics.cube('fill', 0, 1.7, -1, .5, lovr.timer.getTime())\n lovr.graphics.setColor(0xffffff)\n else\n lovr.graphics.setColor(0x000000)\n lovr.graphics.print('No mask found.', 0, 1.7, -3, .2)\n lovr.graphics.setColor(0xffffff)\n end\nend"
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
variants = {
|
|
variants = {
|
|
{
|
|
{
|
|
arguments = {},
|
|
arguments = {},
|
|
@@ -16608,6 +16587,11 @@ return {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ },
|
|
|
|
+ examples = {
|
|
|
|
+ {
|
|
|
|
+ code = "function lovr.load()\n lovr.graphics.setBackgroundColor(1, 1, 1)\n\n shader = lovr.graphics.newShader([[\n vec4 position(mat4 projection, mat4 transform, vec4 vertex) {\n\n // Rescale mesh coordinates from (0,1) to (-1,1)\n vertex.xy *= 2.;\n vertex.xy -= 1.;\n\n // Flip the mesh if it's being drawn in the right eye\n if (lovrViewID == 1) {\n vertex.x = -vertex.x;\n }\n\n return vertex;\n }\n ]], [[\n // The fragment shader returns solid black for illustration purposes. It could be transparent.\n vec4 color(vec4 graphicsColor, sampler2D image, vec2 uv) {\n return vec4(0., 0., 0., 1.);\n }\n ]])\n\n mask = lovr.headset.getDisplayMask()\n\n if mask then\n mesh = lovr.graphics.newMesh({ { 'lovrPosition', 'float', 2 } }, mask, 'triangles')\n end\nend\n\nfunction lovr.draw()\n if mask then\n -- Mask out parts of the display that aren't visible to skip rendering those pixels later\n lovr.graphics.setShader(shader)\n mesh:draw()\n lovr.graphics.setShader()\n\n -- Draw a red cube\n lovr.graphics.setColor(0xff0000)\n lovr.graphics.cube('fill', 0, 1.7, -1, .5, lovr.timer.getTime())\n lovr.graphics.setColor(0xffffff)\n else\n lovr.graphics.setColor(0x000000)\n lovr.graphics.print('No mask found.', 0, 1.7, -3, .2)\n lovr.graphics.setColor(0xffffff)\n end\nend"
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -17338,6 +17322,7 @@ return {
|
|
name = "options",
|
|
name = "options",
|
|
type = "table",
|
|
type = "table",
|
|
description = "Options for loading the model.",
|
|
description = "Options for loading the model.",
|
|
|
|
+ default = "{}",
|
|
table = {
|
|
table = {
|
|
{
|
|
{
|
|
name = "animated",
|
|
name = "animated",
|
|
@@ -17345,8 +17330,7 @@ return {
|
|
description = "Whether an animatable model should be loaded, for use with `lovr.headset.animate`.",
|
|
description = "Whether an animatable model should be loaded, for use with `lovr.headset.animate`.",
|
|
default = "false"
|
|
default = "false"
|
|
}
|
|
}
|
|
- },
|
|
|
|
- default = "{}"
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
returns = {
|
|
returns = {
|
|
@@ -17375,7 +17359,15 @@ return {
|
|
type = "function",
|
|
type = "function",
|
|
description = "The function used to render. Any functions called will render to the headset instead of to the window.",
|
|
description = "The function used to render. Any functions called will render to the headset instead of to the window.",
|
|
arguments = {},
|
|
arguments = {},
|
|
- returns = {}
|
|
|
|
|
|
+ returns = {},
|
|
|
|
+ variants = {
|
|
|
|
+ {
|
|
|
|
+ arguments = {
|
|
|
|
+ "callback"
|
|
|
|
+ },
|
|
|
|
+ returns = {}
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
returns = {}
|
|
returns = {}
|