diff --git a/_data/ref/beta/dmGraphics.json b/_data/ref/beta/dmGraphics.json index 040f8cf4f..250d572fa 100644 --- a/_data/ref/beta/dmGraphics.json +++ b/_data/ref/beta/dmGraphics.json @@ -138,73 +138,6 @@ "tparams": [], "type": "ENUM" }, - { - "brief": "", - "description": "", - "error": "", - "examples": "", - "language": "", - "members": [ - { - "doc": "", - "name": "ACCESS_FLAG_READ", - "type": "" - }, - { - "doc": "", - "name": "ACCESS_FLAG_WRITE", - "type": "" - }, - { - "doc": "", - "name": "ACCESS_FLAG_SHADER", - "type": "" - } - ], - "name": "BarrierAccessFlags", - "notes": [], - "parameters": [], - "replaces": "", - "returnvalues": [], - "tparams": [], - "type": "ENUM" - }, - { - "brief": "", - "description": "", - "error": "", - "examples": "", - "language": "", - "members": [ - { - "doc": "", - "name": "STAGE_FLAG_QUEUE_BEGIN", - "type": "" - }, - { - "doc": "", - "name": "STAGE_FLAG_QUEUE_END", - "type": "" - }, - { - "doc": "", - "name": "STAGE_FLAG_FRAGMENT_SHADER", - "type": "" - }, - { - "doc": "", - "name": "STAGE_FLAG_EARLY_FRAGMENT_SHADER_TEST", - "type": "" - } - ], - "name": "BarrierStageFlags", - "notes": [], - "parameters": [], - "replaces": "", - "returnvalues": [], - "tparams": [], - "type": "ENUM" - }, { "brief": "Blend factor", "description": "Blend factor", @@ -1273,44 +1206,6 @@ "tparams": [], "type": "TYPEDEF" }, - { - "brief": "Create a new storage buffer", - "description": "Create a new storage buffer", - "error": "", - "examples": "", - "language": "", - "members": [], - "name": "HStorageBuffer", - "notes": [], - "parameters": [ - { - "doc": "the vulkan context", - "name": "context", - "types": [ - "dmGraphics::HContext" - ] - }, - { - "doc": "the size of the storage buffer to allocate", - "name": "buffer_size", - "types": [ - "uint32_t" - ] - } - ], - "replaces": "", - "returnvalues": [ - { - "doc": "the storage buffer", - "name": "storage_buffer", - "types": [ - "dmGraphics::HStorageBuffer" - ] - } - ], - "tparams": [], - "type": "FUNCTION" - }, { "brief": "Texture handle", "description": "Texture handle", @@ -1442,21 +1337,6 @@ "tparams": [], "type": "FUNCTION" }, - { - "brief": "Max subpasses", - "description": "Max subpasses", - "error": "", - "examples": "", - "language": "", - "members": [], - "name": "INVALID_STREAM_OFFSET", - "notes": [], - "parameters": [], - "replaces": "", - "returnvalues": [], - "tparams": [], - "type": "FUNCTION" - }, { "brief": "check if an extension is supported", "description": "check if an extension is supported", @@ -1585,21 +1465,6 @@ "tparams": [], "type": "FUNCTION" }, - { - "brief": "Max subpass dependencies", - "description": "Max subpass dependencies", - "error": "", - "examples": "", - "language": "", - "members": [], - "name": "MAX_SUBPASS_DEPENDENCIES", - "notes": [], - "parameters": [], - "replaces": "", - "returnvalues": [], - "tparams": [], - "type": "FUNCTION" - }, { "brief": "Create new index buffer with initial data", "description": "Create new index buffer with initial data", @@ -2195,36 +2060,6 @@ "tparams": [], "type": "ENUM" }, - { - "brief": "Subpass attachment unused flag", - "description": "Subpass attachment unused flag", - "error": "", - "examples": "", - "language": "", - "members": [], - "name": "SUBPASS_ATTACHMENT_UNUSED", - "notes": [], - "parameters": [], - "replaces": "", - "returnvalues": [], - "tparams": [], - "type": "FUNCTION" - }, - { - "brief": "Subpass external", - "description": "Subpass external", - "error": "", - "examples": "", - "language": "", - "members": [], - "name": "SUBPASS_EXTERNAL", - "notes": [], - "parameters": [], - "replaces": "", - "returnvalues": [], - "tparams": [], - "type": "FUNCTION" - }, { "brief": "", "description": "", @@ -2503,13 +2338,13 @@ "type": "ENUM" }, { - "brief": "Clear a texture with RGBA values", - "description": "Clear a texture with RGBA values", + "brief": "Get the current swap chain texture", + "description": "Get the current swap chain texture", "error": "", "examples": "", "language": "", "members": [], - "name": "VulkanClearTexture", + "name": "VulkanGetActiveSwapChainTexture", "notes": [], "parameters": [ { @@ -2518,107 +2353,29 @@ "types": [ "dmGraphics::HContext" ] - }, - { - "doc": "the texture to clear", - "name": "texture", - "types": [ - "dmGraphics::HTexture" - ] - }, - { - "doc": "] the clear values", - "name": "values", - "types": [ - "float[4" - ] } ], "replaces": "", - "returnvalues": [], - "tparams": [], - "type": "FUNCTION" - }, - { - "brief": "Copy a buffer to a texture", - "description": "Copy a buffer to a texture", - "error": "", - "examples": "", - "language": "", - "members": [], - "name": "VulkanCopyBufferToTexture", - "notes": [], - "parameters": [ - { - "doc": "the vulkan context", - "name": "context", - "types": [ - "dmGraphics::HContext" - ] - }, - { - "doc": "the buffer to copy into the texture", - "name": "buffer", - "types": [ - "dmGraphics::HVertexBuffer" - ] - }, + "returnvalues": [ { - "doc": "the texture to copy into", - "name": "texture", + "doc": "the swap chain texture for the current frame", + "name": "swapchain", "types": [ "dmGraphics::HTexture" ] - }, - { - "doc": "width of the texture slice to copy", - "name": "width", - "types": [ - "uint32_t" - ] - }, - { - "doc": "height of the texture slice to copy", - "name": "height", - "types": [ - "uint32_t" - ] - }, - { - "doc": "x offset into the texture", - "name": "x", - "types": [ - "uint32_t" - ] - }, - { - "doc": "y offset into the texture", - "name": "y", - "types": [ - "uint32_t" - ] - }, - { - "doc": "the mipmap slice to upload", - "name": "mipmap", - "types": [ - "uint32_t" - ] } ], - "replaces": "", - "returnvalues": [], "tparams": [], "type": "FUNCTION" }, { - "brief": "Create a render pass", - "description": "Create a render pass", + "brief": "Get the native MTLCommandQueue from the Vulkan con...", + "description": "Get the native MTLCommandQueue from the Vulkan context. Only available when using Mac/iOS.", "error": "", "examples": "", "language": "", "members": [], - "name": "VulkanCreateRenderPass", + "name": "VulkanGraphicsCommandQueueToMetal", "notes": [], "parameters": [ { @@ -2627,65 +2384,29 @@ "types": [ "dmGraphics::HContext" ] - }, - { - "doc": "the render target", - "name": "render_target", - "types": [ - "dmGraphics::HRenderTarget" - ] - }, - { - "doc": "params", - "name": "params", - "types": [ - "dmGraphics::CreateRenderPassParams" - ] } ], "replaces": "", - "returnvalues": [], - "tparams": [], - "type": "FUNCTION" - }, - { - "brief": "Delete a storage buffer", - "description": "Delete a storage buffer", - "error": "", - "examples": "", - "language": "", - "members": [], - "name": "VulkanDeleteStorageBuffer", - "notes": [], - "parameters": [ - { - "doc": "the vulkan context", - "name": "context", - "types": [ - "dmGraphics::HContext" - ] - }, + "returnvalues": [ { - "doc": "the attachment to get", - "name": "storage_buffer", + "doc": "the Metal graphics queue wrapped with a (__bridge void*)", + "name": "mtl_queue", "types": [ - "dmGraphics::HStorageBuffer" + "id" ] } ], - "replaces": "", - "returnvalues": [], "tparams": [], "type": "FUNCTION" }, { - "brief": "Draw with vertex buffer instanced", - "description": "Draw with vertex buffer instanced", + "brief": "Get a native MTLTexture from a Vulkan HTexture. On...", + "description": "Get a native MTLTexture from a Vulkan HTexture. Only available when using Mac/iOS.", "error": "", "examples": "", "language": "", "members": [], - "name": "VulkanDrawBaseInstance", + "name": "VulkanTextureToMetal", "notes": [], "parameters": [ { @@ -2696,742 +2417,18 @@ ] }, { - "doc": "primitive type", - "name": "prim_type", + "doc": "the texture", + "name": "texture", "types": [ - "dmGraphics::PrimitiveType" + "dmGraphics::HTexture" ] - }, + } + ], + "replaces": "", + "returnvalues": [ { - "doc": "the byte offset into the index buffer", - "name": "first", - "types": [ - "uint32_t" - ] - }, - { - "doc": "number of primitives to draw", - "name": "count", - "types": [ - "uint32_t" - ] - }, - { - "doc": "number of instances to draw", - "name": "instance_count", - "types": [ - "uint32_t" - ] - }, - { - "doc": "the index buffer type", - "name": "type", - "types": [ - "dmGraphics::Type" - ] - }, - { - "doc": "the index buffer", - "name": "index_buffer", - "types": [ - "dmGraphics::HIndexBuffer" - ] - } - ], - "replaces": "", - "returnvalues": [], - "tparams": [], - "type": "FUNCTION" - }, - { - "brief": "Draw with index buffer instanced", - "description": "Draw with index buffer instanced", - "error": "", - "examples": "", - "language": "", - "members": [], - "name": "VulkanDrawElementsInstanced", - "notes": [], - "parameters": [ - { - "doc": "the vulkan context", - "name": "context", - "types": [ - "dmGraphics::HContext" - ] - }, - { - "doc": "primitive type", - "name": "prim_type", - "types": [ - "dmGraphics::PrimitiveType" - ] - }, - { - "doc": "the byte offset into the index buffer", - "name": "first", - "types": [ - "uint32_t" - ] - }, - { - "doc": "number of primitives to draw", - "name": "count", - "types": [ - "uint32_t" - ] - }, - { - "doc": "number of instances to draw", - "name": "instance_count", - "types": [ - "uint32_t" - ] - }, - { - "doc": "the index buffer type", - "name": "type", - "types": [ - "dmGraphics::Type" - ] - }, - { - "doc": "the index buffer", - "name": "index_buffer", - "types": [ - "dmGraphics::HIndexBuffer" - ] - } - ], - "replaces": "", - "returnvalues": [], - "tparams": [], - "type": "FUNCTION" - }, - { - "brief": "Get the current swap chain texture", - "description": "Get the current swap chain texture", - "error": "", - "examples": "", - "language": "", - "members": [], - "name": "VulkanGetActiveSwapChainTexture", - "notes": [], - "parameters": [ - { - "doc": "the vulkan context", - "name": "context", - "types": [ - "dmGraphics::HContext" - ] - } - ], - "replaces": "", - "returnvalues": [ - { - "doc": "the swap chain texture for the current frame", - "name": "swapchain", - "types": [ - "dmGraphics::HTexture" - ] - } - ], - "tparams": [], - "type": "FUNCTION" - }, - { - "brief": "Get the vulkan context of the installed adapter", - "description": "Get the vulkan context of the installed adapter", - "error": "", - "examples": "", - "language": "", - "members": [], - "name": "VulkanGetContext", - "notes": [], - "parameters": [], - "replaces": "", - "returnvalues": [ - { - "doc": "the vulkan context", - "name": "context", - "types": [ - "dmGraphics::HContext" - ] - } - ], - "tparams": [], - "type": "FUNCTION" - }, - { - "brief": "Get the set and binding information from a uniform...", - "description": "Get the set and binding information from a uniform index", - "error": "", - "examples": "", - "language": "", - "members": [], - "name": "VulkanGetUniformBinding", - "notes": [], - "parameters": [ - { - "doc": "the vulkan context", - "name": "context", - "types": [ - "dmGraphics::HContext" - ] - }, - { - "doc": "the program to query", - "name": "program", - "types": [ - "dmGraphics::HProgram" - ] - }, - { - "doc": "uniform index", - "name": "index", - "types": [ - "uint32_t" - ] - }, - { - "doc": "a pointer to store the result of the set number", - "name": "set", - "types": [ - "uint32_t*" - ] - }, - { - "doc": "a pointer to store the result of the binding number", - "name": "binding", - "types": [ - "uint32_t*" - ] - }, - { - "doc": "a pointer to store the result of the member index", - "name": "member_index", - "types": [ - "uint32_t*" - ] - } - ], - "replaces": "", - "returnvalues": [], - "tparams": [], - "type": "FUNCTION" - }, - { - "brief": "Get the native MTLCommandQueue from the Vulkan con...", - "description": "Get the native MTLCommandQueue from the Vulkan context", - "error": "", - "examples": "", - "language": "", - "members": [], - "name": "VulkanGraphicsCommandQueueToMetal", - "notes": [], - "parameters": [ - { - "doc": "the vulkan context", - "name": "context", - "types": [ - "dmGraphics::HContext" - ] - } - ], - "replaces": "", - "returnvalues": [ - { - "doc": "the Metal graphics queue wrapped with a (__bridge void*)", - "name": "mtl_queue", - "types": [ - "id" - ] - } - ], - "tparams": [], - "type": "FUNCTION" - }, - { - "brief": "Map the GPU data for a index buffer", - "description": "Map the GPU data for a index buffer", - "error": "", - "examples": "", - "language": "", - "members": [], - "name": "VulkanMapIndexBuffer", - "notes": [], - "parameters": [ - { - "doc": "the vulkan context", - "name": "context", - "types": [ - "dmGraphics::HContext" - ] - }, - { - "doc": "the buffer to map", - "name": "buffer", - "types": [ - "dmGraphics::HIndexBuffer" - ] - }, - { - "doc": "how to access the buffer", - "name": "buffer_access", - "types": [ - "dmGraphics::BufferAccess" - ] - } - ], - "replaces": "", - "returnvalues": [ - { - "doc": "the mapped data buffer", - "name": "void*", - "types": [ - "void*" - ] - } - ], - "tparams": [], - "type": "FUNCTION" - }, - { - "brief": "Map the GPU data for a vertex buffer", - "description": "Map the GPU data for a vertex buffer", - "error": "", - "examples": "", - "language": "", - "members": [], - "name": "VulkanMapVertexBuffer", - "notes": [], - "parameters": [ - { - "doc": "the vulkan context", - "name": "context", - "types": [ - "dmGraphics::HContext" - ] - }, - { - "doc": "the buffer to map", - "name": "buffer", - "types": [ - "dmGraphics::HVertexBuffer" - ] - }, - { - "doc": "how to access the buffer", - "name": "buffer_access", - "types": [ - "dmGraphics::BufferAccess" - ] - } - ], - "replaces": "", - "returnvalues": [ - { - "doc": "the mapped data buffer", - "name": "void*", - "types": [ - "void*" - ] - } - ], - "tparams": [], - "type": "FUNCTION" - }, - { - "brief": "Insert a memory barrier", - "description": "Insert a memory barrier", - "error": "", - "examples": "", - "language": "", - "members": [], - "name": "VulkanMemorybarrier", - "notes": [], - "parameters": [ - { - "doc": "the vulkan context", - "name": "context", - "types": [ - "dmGraphics::HContext" - ] - }, - { - "doc": "the texture to set barrier for", - "name": "texture", - "types": [ - "dmGraphics::HTexture" - ] - }, - { - "doc": "src stage flag", - "name": "src_stage_flags", - "types": [ - "uint32_t" - ] - }, - { - "doc": "dst stage flag", - "name": "dst_stage_flags", - "types": [ - "uint32_t" - ] - }, - { - "doc": "src access flag", - "name": "src_access_flags", - "types": [ - "uint32_t" - ] - }, - { - "doc": "dst access flag", - "name": "dst_access_flags", - "types": [ - "uint32_t" - ] - } - ], - "replaces": "", - "returnvalues": [], - "tparams": [], - "type": "FUNCTION" - }, - { - "brief": "Advance the render pass to the next sub pass", - "description": "Advance the render pass to the next sub pass", - "error": "", - "examples": "", - "language": "", - "members": [], - "name": "VulkanNextRenderPass", - "notes": [], - "parameters": [ - { - "doc": "the vulkan context", - "name": "context", - "types": [ - "dmGraphics::HContext" - ] - }, - { - "doc": "the render target to advance", - "name": "render_target", - "types": [ - "dmGraphics::HRenderTarget" - ] - } - ], - "replaces": "", - "returnvalues": [], - "tparams": [], - "type": "FUNCTION" - }, - { - "brief": "Bind a constant buffer to the currently bound shad...", - "description": "Bind a constant buffer to the currently bound shader", - "error": "", - "examples": "", - "language": "", - "members": [], - "name": "VulkanSetConstantBuffer", - "notes": [], - "parameters": [ - { - "doc": "the vulkan context", - "name": "context", - "types": [ - "dmGraphics::HContext" - ] - }, - { - "doc": "the constant buffer", - "name": "buffer", - "types": [ - "dmGraphics::HVertexBuffer" - ] - }, - { - "doc": "offset location for the buffer", - "name": "buffer_offset", - "types": [ - "uint32_t" - ] - }, - { - "doc": "the shader location to bind to", - "name": "base_location", - "types": [ - "dmGraphics::HUniformLocation" - ] - } - ], - "replaces": "", - "returnvalues": [], - "tparams": [], - "type": "FUNCTION" - }, - { - "brief": "Set the number of in-flight frames that the vulkan...", - "description": "Set the number of in-flight frames that the vulkan layer uses", - "error": "", - "examples": "", - "language": "", - "members": [], - "name": "VulkanSetFrameInFlightCount", - "notes": [], - "parameters": [ - { - "doc": "the vulkan context", - "name": "context", - "types": [ - "dmGraphics::HContext" - ] - }, - { - "doc": "the max number of frames in flight", - "name": "num_frames_in_flight", - "types": [ - "uint8_t" - ] - } - ], - "replaces": "", - "returnvalues": [], - "tparams": [], - "type": "FUNCTION" - }, - { - "brief": "Set the entire current pipeline state", - "description": "Set the entire current pipeline state", - "error": "", - "examples": "", - "language": "", - "members": [], - "name": "VulkanSetPipelineState", - "notes": [], - "parameters": [ - { - "doc": "the vulkan context", - "name": "context", - "types": [ - "dmGraphics::HContext" - ] - }, - { - "doc": "the pipeline state", - "name": "ps", - "types": [ - "dmGraphics::PipelineState" - ] - } - ], - "replaces": "", - "returnvalues": [], - "tparams": [], - "type": "FUNCTION" - }, - { - "brief": "Sets the attachments for a render target", - "description": "Sets the attachments for a render target", - "error": "", - "examples": "", - "language": "", - "members": [], - "name": "VulkanSetRenderTargetAttachments", - "notes": [], - "parameters": [ - { - "doc": "the vulkan context", - "name": "context", - "types": [ - "dmGraphics::HContext" - ] - }, - { - "doc": "the render target", - "name": "render_target", - "types": [ - "dmGraphics::HRenderTarget" - ] - }, - { - "doc": "the render target attachment params", - "name": "params", - "types": [ - "dmGraphics::SetRenderTargetAttachmentsParams" - ] - } - ], - "replaces": "", - "returnvalues": [], - "tparams": [], - "type": "FUNCTION" - }, - { - "brief": "Bind a storage buffer to the render state", - "description": "Bind a storage buffer to the render state", - "error": "", - "examples": "", - "language": "", - "members": [], - "name": "VulkanSetStorageBuffer", - "notes": [], - "parameters": [ - { - "doc": "the vulkan context", - "name": "context", - "types": [ - "dmGraphics::HContext" - ] - }, - { - "doc": "the storage buffer to bind", - "name": "storage_buffer", - "types": [ - "dmGraphics::HStorageBuffer" - ] - }, - { - "doc": "binding index", - "name": "binding_index", - "types": [ - "uint32_t" - ] - }, - { - "doc": "the buffer offset", - "name": "buffer_offset", - "types": [ - "uint32_t" - ] - }, - { - "doc": "the shader location to bind to", - "name": "base_location", - "types": [ - "dmGraphics::HUniformLocation" - ] - } - ], - "replaces": "", - "returnvalues": [], - "tparams": [], - "type": "FUNCTION" - }, - { - "brief": "Set the storage buffer data", - "description": "Set the storage buffer data", - "error": "", - "examples": "", - "language": "", - "members": [], - "name": "VulkanSetStorageBufferData", - "notes": [], - "parameters": [ - { - "doc": "the vulkan context", - "name": "context", - "types": [ - "dmGraphics::HContext" - ] - }, - { - "doc": "the storage buffer", - "name": "storage_buffer", - "types": [ - "dmGraphics::HStorageBuffer" - ] - }, - { - "doc": "size of the input data", - "name": "size", - "types": [ - "uint32_t" - ] - }, - { - "doc": "the buffer data", - "name": "data", - "types": [ - "void*" - ] - } - ], - "replaces": "", - "returnvalues": [], - "tparams": [], - "type": "FUNCTION" - }, - { - "brief": "Set the step function for a vertex declaration", - "description": "Set the step function for a vertex declaration", - "error": "", - "examples": "", - "language": "", - "members": [], - "name": "VulkanSetVertexDeclarationStepFunction", - "notes": [], - "parameters": [ - { - "doc": "the vulkan context", - "name": "context", - "types": [ - "dmGraphics::HContext" - ] - }, - { - "doc": "the vertex declaration to set step function for", - "name": "vertex_declaration", - "types": [ - "dmGraphics::HVertexDeclaration" - ] - }, - { - "doc": "the step function", - "name": "step_function", - "types": [ - "dmGraphics::VertexStepFunction" - ] - } - ], - "replaces": "", - "returnvalues": [], - "tparams": [], - "type": "FUNCTION" - }, - { - "brief": "Get a native MTLTexture from a Vulkan HTexture", - "description": "Get a native MTLTexture from a Vulkan HTexture", - "error": "", - "examples": "", - "language": "", - "members": [], - "name": "VulkanTextureToMetal", - "notes": [], - "parameters": [ - { - "doc": "the vulkan context", - "name": "context", - "types": [ - "dmGraphics::HContext" - ] - }, - { - "doc": "the texture", - "name": "texture", - "types": [ - "dmGraphics::HTexture" - ] - } - ], - "replaces": "", - "returnvalues": [ - { - "doc": "the Metal texture wrapped with a (__bridge void*)", - "name": "mtl_texture", + "doc": "the Metal texture wrapped with a (__bridge void*)", + "name": "mtl_texture", "types": [ "id" ] @@ -3439,82 +2436,6 @@ ], "tparams": [], "type": "FUNCTION" - }, - { - "brief": "Unmap a index buffer", - "description": "Unmap a index buffer", - "error": "", - "examples": "", - "language": "", - "members": [], - "name": "VulkanUnmapIndexBuffer", - "notes": [], - "parameters": [ - { - "doc": "the vulkan context", - "name": "context", - "types": [ - "dmGraphics::HContext" - ] - }, - { - "doc": "the buffer", - "name": "buffer", - "types": [ - "dmGraphics::HIndexBuffer" - ] - } - ], - "replaces": "", - "returnvalues": [ - { - "doc": "unused", - "name": "flag", - "types": [ - "bool" - ] - } - ], - "tparams": [], - "type": "FUNCTION" - }, - { - "brief": "Unmap a vertex buffer", - "description": "Unmap a vertex buffer", - "error": "", - "examples": "", - "language": "", - "members": [], - "name": "VulkanUnmapVertexBuffer", - "notes": [], - "parameters": [ - { - "doc": "the vulkan context", - "name": "context", - "types": [ - "dmGraphics::HContext" - ] - }, - { - "doc": "the buffer", - "name": "buffer", - "types": [ - "dmGraphics::HVertexBuffer" - ] - } - ], - "replaces": "", - "returnvalues": [ - { - "doc": "unused", - "name": "flag", - "types": [ - "bool" - ] - } - ], - "tparams": [], - "type": "FUNCTION" } ], "info": { diff --git a/_data/ref/beta/dmScript.json b/_data/ref/beta/dmScript.json index 7808ff1fb..a69689802 100644 --- a/_data/ref/beta/dmScript.json +++ b/_data/ref/beta/dmScript.json @@ -273,6 +273,7 @@ "name": "dmScript::CheckBufferNoError", "notes": [ "Returns 0 on error. Does not invoke lua_error.", + "deprecated. Prefer ToBuffer() instead.", "The dmBuffer::IsBufferValid is already called on the returned buffer" ], "parameters": [ @@ -1526,6 +1527,47 @@ "tparams": [], "type": "FUNCTION" }, + { + "brief": "retrieve a LuaHBuffer from the supplied lua state.", + "description": "Retrieve a LuaHBuffer from the supplied lua state.\nCheck if the value in the supplied index on the lua stack is a LuaHBuffer and returns it.", + "error": "", + "examples": "", + "language": "", + "members": [], + "name": "dmScript::ToBuffer", + "notes": [ + "Returns 0 on error. Does not invoke lua_error.", + "The dmBuffer::IsBufferValid is already called on the returned buffer" + ], + "parameters": [ + { + "doc": "lua state", + "name": "L", + "types": [ + "lua_State*" + ] + }, + { + "doc": "Index of the value", + "name": "index", + "types": [ + "int" + ] + } + ], + "replaces": "", + "returnvalues": [ + { + "doc": "pointer to dmScript::LuaHBuffer or 0 if not valid", + "name": "buffer", + "types": [ + "LuaHBuffer*" + ] + } + ], + "tparams": [], + "type": "FUNCTION" + }, { "brief": "Check if the value at #index is a hash", "description": "Check if the value at #index is a hash", diff --git a/_data/ref/beta/editor.json b/_data/ref/beta/editor.json index 4c381f24e..b62ca8ee6 100644 --- a/_data/ref/beta/editor.json +++ b/_data/ref/beta/editor.json @@ -30,6 +30,29 @@ "tparams": [], "type": "FUNCTION" }, + { + "brief": "open a URL in the default browser or a registered application", + "description": "Open a URL in the default browser or a registered application", + "error": "", + "examples": "", + "language": "", + "members": [], + "name": "editor.browse", + "notes": [], + "parameters": [ + { + "doc": "http(s) or file URL", + "name": "url", + "types": [ + "string" + ] + } + ], + "replaces": "", + "returnvalues": [], + "tparams": [], + "type": "FUNCTION" + }, { "brief": "check if you can get this property so editor.get() won't throw an error", "description": "Check if you can get this property so editor.get() won't throw an error", diff --git a/_data/ref/beta/liveupdate.json b/_data/ref/beta/liveupdate.json index 423cece4a..7d1a51757 100644 --- a/_data/ref/beta/liveupdate.json +++ b/_data/ref/beta/liveupdate.json @@ -4,7 +4,7 @@ "brief": "Add resource mount", "description": "Adds a resource mount to the resource system.\nThe mounts are persisted between sessions.\nAfter the mount succeeded, the resources are available to load. (i.e. no reboot required)", "error": "", - "examples": "Add multiple mounts. Higher priority takes precedence.\n
liveupdate.add_mount("common", "zip:/path/to/common_stuff.zip", 10) -- base pack\nliveupdate.add_mount("levelpack_1", "zip:/path/to/levels_1_to_20.zip", 20) -- level pack\nliveupdate.add_mount("season_pack_1", "zip:/path/to/easter_pack_1.zip", 30) -- season pack, overriding content in the other packs\n
", + "examples": "Add multiple mounts. Higher priority takes precedence.\n
liveupdate.add_mount("common", "zip:/path/to/common_stuff.zip", 10, function (result) end) -- base pack\nliveupdate.add_mount("levelpack_1", "zip:/path/to/levels_1_to_20.zip", 20, function (result) end) -- level pack\nliveupdate.add_mount("season_pack_1", "zip:/path/to/easter_pack_1.zip", 30, function (result) end) -- season pack, overriding content in the other packs\n
", "language": "", "members": [], "name": "liveupdate.add_mount", diff --git a/_data/ref/beta/physics.json b/_data/ref/beta/physics.json index 83a8eb476..22a290441 100644 --- a/_data/ref/beta/physics.json +++ b/_data/ref/beta/physics.json @@ -1022,7 +1022,7 @@ }, { "brief": "requests a ray cast to be performed", - "description": "Ray casts are used to test for intersections against collision objects in the physics world.\nCollision objects of types kinematic, dynamic and static are tested against. Trigger objects\ndo not intersect with ray casts.\nWhich collision objects to hit is filtered by their collision groups and can be configured\nthrough groups.", + "description": "Ray casts are used to test for intersections against collision objects in the physics world.\nCollision objects of types kinematic, dynamic and static are tested against. Trigger objects\ndo not intersect with ray casts.\nWhich collision objects to hit is filtered by their collision groups and can be configured\nthrough groups.\nNOTE: Ray casts will ignore collision objects that contain the starting point of the ray. This is a limitation in Box2D.", "error": "", "examples": "How to perform a ray cast synchronously:\n
function init(self)\n    self.groups = {hash("world"), hash("enemy")}\nend\n\nfunction update(self, dt)\n    -- request ray cast\n    local result = physics.raycast(from, to, self.groups, {all=true})\n    if result ~= nil then\n        -- act on the hit (see 'ray_cast_response')\n        for _,result in ipairs(results) do\n            handle_result(result)\n        end\n    end\nend\n
", "language": "", @@ -1075,7 +1075,7 @@ }, { "brief": "requests a ray cast to be performed", - "description": "Ray casts are used to test for intersections against collision objects in the physics world.\nCollision objects of types kinematic, dynamic and static are tested against. Trigger objects\ndo not intersect with ray casts.\nWhich collision objects to hit is filtered by their collision groups and can be configured\nthrough groups.\nThe actual ray cast will be performed during the physics-update.\n
    \n
  • If an object is hit, the result will be reported via a ray_cast_response message.
  • \n
  • If there is no object hit, the result will be reported via a ray_cast_missed message.
  • \n
", + "description": "Ray casts are used to test for intersections against collision objects in the physics world.\nCollision objects of types kinematic, dynamic and static are tested against. Trigger objects\ndo not intersect with ray casts.\nWhich collision objects to hit is filtered by their collision groups and can be configured\nthrough groups.\nThe actual ray cast will be performed during the physics-update.\n
    \n
  • If an object is hit, the result will be reported via a ray_cast_response message.
  • \n
  • If there is no object hit, the result will be reported via a ray_cast_missed message.
  • \n
\nNOTE: Ray casts will ignore collision objects that contain the starting point of the ray. This is a limitation in Box2D.", "error": "", "examples": "How to perform a ray cast asynchronously:\n
function init(self)\n    self.my_groups = {hash("my_group1"), hash("my_group2")}\nend\n\nfunction update(self, dt)\n    -- request ray cast\n    physics.raycast_async(my_start, my_end, self.my_groups)\nend\n\nfunction on_message(self, message_id, message, sender)\n    -- check for the response\n    if message_id == hash("ray_cast_response") then\n        -- act on the hit\n    elseif message_id == hash("ray_cast_missed") then\n        -- act on the miss\n    end\nend\n
", "language": "", diff --git a/_data/ref/beta/resource.json b/_data/ref/beta/resource.json index 76e2cf582..387822070 100644 --- a/_data/ref/beta/resource.json +++ b/_data/ref/beta/resource.json @@ -140,6 +140,44 @@ "tparams": [], "type": "FUNCTION" }, + { + "brief": "Creates a sound data resource (.oggc/.wavc)", + "description": "Creates a sound data resource\nSupported formats are .oggc and .wavc", + "error": "", + "examples": "
function init(self)\n    -- create a new sound resource, given the initial chunk of the file\n    local relative_path = "/a/unique/resource/name.oggc"\n    local hash = resource.create_sound_data(relative_path, { data = data, filesize = filesize, partial = true })\n    go.set("#music", "sound", hash) -- override the previous sound resource\n    sound.play("#music") -- start the playing\nend\n
", + "language": "", + "members": [], + "name": "resource.create_sound_data", + "notes": [], + "parameters": [ + { + "doc": "the path to the resource. Must not already exist.", + "name": "path", + "types": [ + "string" + ] + }, + { + "doc": "A table containing parameters for the text. Supported entries:\n
\n
data
\n
string The raw data of the file. May be partial, but must include the header of the file
\n
filesize
\n
number If the file is partial, it must also specify the full size of the complete file.
\n
partial
\n
boolean Is the data not representing the full file, but just the initial chunk?
\n
", + "name": "[options]", + "types": [ + "table" + ] + } + ], + "replaces": "", + "returnvalues": [ + { + "doc": "the resulting path hash to the resource", + "name": "path_hash", + "types": [ + "hash" + ] + } + ], + "tparams": [], + "type": "FUNCTION" + }, { "brief": "create a texture", "description": "Creates a new texture resource that can be used in the same way as any texture created during build time.\nThe path used for creating the texture must be unique, trying to create a resource at a path that is already\nregistered will trigger an error. If the intention is to instead modify an existing texture, use the resource.set_texture\nfunction. Also note that the path to the new texture resource must have a '.texturec' extension,\nmeaning \"/path/my_texture\" is not a valid path but \"/path/my_texture.texturec\" is.\nIf the texture is created without a buffer, the pixel data will be blank.", diff --git a/_data/ref/beta/vmath.json b/_data/ref/beta/vmath.json index 93a85fdcd..8dd16b330 100644 --- a/_data/ref/beta/vmath.json +++ b/_data/ref/beta/vmath.json @@ -4,7 +4,7 @@ "brief": "clamp input value in range [min, max] and return clamped value", "description": "Clamp input value to be in range of [min, max]. In case if input value has vector3|vector4 type\nreturn new vector3|vector4 with clamped value at every vector's element.\nMin/max arguments can be vector3|vector4. In that case clamp excuted per every vector's element", "error": "", - "examples": "", + "examples": "
local value1 = 56\nprint(vmath.clamp(value1, 89, 134)) -> 89\nlocal v2 = vmath.vector3(190, 190, -10)\nprint(vmath.clamp(v2, -50, 150)) -> vmath.vector3(150, 150, -10)\nlocal v3 = vmath.vector4(30, -30, 45, 1)\nprint(vmath.clamp(v3, 0, 20)) -> vmath.vector4(20, 0, 20, 1)\n\nlocal min_v = vmath.vector4(0, -10, -10, 1)\nprint(vmath.clamp(v3, min_v, 20)) -> vmath.vector4(20, -10, 20, 1)\n
", "language": "", "members": [], "name": "vmath.clamp", @@ -166,7 +166,7 @@ "brief": "converts euler angles into a quaternion", "description": "Converts euler angles (x, y, z) in degrees into a quaternion\nThe error is guaranteed to be less than 0.001.\nIf the first argument is vector3, its values are used as x, y, z angles.", "error": "", - "examples": "", + "examples": "
local q = vmath.euler_to_quat(0, 45, 90)\nprint(q) --> vmath.quat(0.27059805393219, 0.27059805393219, 0.65328145027161, 0.65328145027161)\n\nlocal v = vmath.vector3(0, 0, 90)\nprint(vmath.euler_to_quat(v)) --> vmath.quat(0, 0, 0.70710676908493, 0.70710676908493)\n
", "language": "", "members": [], "name": "vmath.euler_to_quat", @@ -1573,7 +1573,7 @@ "brief": "converts a quaternion into euler angles", "description": "Converts a quaternion into euler angles (r0, r1, r2), based on YZX rotation order.\nTo handle gimbal lock (singularity at r1 ~ +/- 90 degrees), the cut off is at r0 = +/- 88.85 degrees, which snaps to +/- 90.\nThe provided quaternion is expected to be normalized.\nThe error is guaranteed to be less than +/- 0.02 degrees", "error": "", - "examples": "", + "examples": "
local q = vmath.quat_rotation_z(math.rad(90))\nprint(vmath.quat_to_euler(q)) --> 0 0 90\n\nlocal q2 = vmath.quat_rotation_y(math.rad(45)) * vmath.quat_rotation_z(math.rad(90))\nlocal v = vmath.vector3(vmath.quat_to_euler(q2))\nprint(v) --> vmath.vector3(0, 45, 90)\n
", "language": "", "members": [], "name": "vmath.quat_to_euler",