diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-08-13 01:23:32 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-08-13 01:23:32 +0800 |
commit | 04fa96b7c0abba4d7cca03ed12ff3b65b3912e01 (patch) | |
tree | c0c8a2c0e92d0580280f838ba475875c7f82a73c /meta/3rd/Cocos4.0/library/ccb | |
parent | c30c5c2e267f6917600afe4f19e1e0d674bad9c6 (diff) | |
download | lua-language-server-04fa96b7c0abba4d7cca03ed12ff3b65b3912e01.zip |
fix #1431
Diffstat (limited to 'meta/3rd/Cocos4.0/library/ccb')
-rw-r--r-- | meta/3rd/Cocos4.0/library/ccb/Program.lua | 54 | ||||
-rw-r--r-- | meta/3rd/Cocos4.0/library/ccb/ProgramState.lua | 43 | ||||
-rw-r--r-- | meta/3rd/Cocos4.0/library/ccb/Texture2DBackend.lua | 73 | ||||
-rw-r--r-- | meta/3rd/Cocos4.0/library/ccb/TextureBackend.lua | 51 | ||||
-rw-r--r-- | meta/3rd/Cocos4.0/library/ccb/TextureCubemapBackend.lua | 16 | ||||
-rw-r--r-- | meta/3rd/Cocos4.0/library/ccb/VertexLayout.lua | 42 |
6 files changed, 279 insertions, 0 deletions
diff --git a/meta/3rd/Cocos4.0/library/ccb/Program.lua b/meta/3rd/Cocos4.0/library/ccb/Program.lua new file mode 100644 index 00000000..01759b99 --- /dev/null +++ b/meta/3rd/Cocos4.0/library/ccb/Program.lua @@ -0,0 +1,54 @@ +---@meta + +---@class ccb.Program :cc.Ref +local Program={ } +ccb.Program=Program + + + + +---* Get maximum vertex location.<br> +---* return Maximum vertex locaiton. +---@return int +function Program:getMaxVertexLocation () end +---* Get maximum fragment location.<br> +---* return Maximum fragment location. +---@return int +function Program:getMaxFragmentLocation () end +---* Get fragment shader.<br> +---* Fragment shader. +---@return string +function Program:getFragmentShader () end +---* Get uniform buffer size in bytes that can hold all the uniforms.<br> +---* param stage Specifies the shader stage. The symbolic constant can be either VERTEX or FRAGMENT.<br> +---* return The uniform buffer size in bytes. +---@param stage int +---@return unsigned_int +function Program:getUniformBufferSize (stage) end +---@overload fun(string0:int):self +---@overload fun(string:string):self +---@param uniform string +---@return cc.backend.UniformLocation +function Program:getUniformLocation (uniform) end +---* Get engine built-in program type.<br> +---* return The built-in program type. +---@return int +function Program:getProgramType () end +---* Get active vertex attributes.<br> +---* return Active vertex attributes. key is active attribute name, Value is corresponding attribute info. +---@return map_table +function Program:getActiveAttributes () end +---@overload fun(string0:int):self +---@overload fun(string:string):self +---@param name string +---@return int +function Program:getAttributeLocation (name) end +---* Get vertex shader.<br> +---* return Vertex shader. +---@return string +function Program:getVertexShader () end +---* Get engine built-in program.<br> +---* param type Specifies the built-in program type. +---@param type int +---@return cc.backend.Program +function Program:getBuiltinProgram (type) end
\ No newline at end of file diff --git a/meta/3rd/Cocos4.0/library/ccb/ProgramState.lua b/meta/3rd/Cocos4.0/library/ccb/ProgramState.lua new file mode 100644 index 00000000..942a120a --- /dev/null +++ b/meta/3rd/Cocos4.0/library/ccb/ProgramState.lua @@ -0,0 +1,43 @@ +---@meta + +---@class ccb.ProgramState :cc.Ref +local ProgramState={ } +ccb.ProgramState=ProgramState + + + + +---* Set texture.<br> +---* param uniformLocation Specifies texture location.<br> +---* param slot Specifies texture slot selector.<br> +---* param texture Specifies a pointer to backend texture. +---@param uniformLocation cc.backend.UniformLocation +---@param slot unsigned_int +---@param texture cc.backend.TextureBackend +---@return cc.backend.ProgramState +function ProgramState:setTexture (uniformLocation,slot,texture) end +---* Deep clone ProgramState +---@return cc.backend.ProgramState +function ProgramState:clone () end +---* Sets a uniform auto-binding.<br> +---* This method parses the passed in autoBinding string and attempts to convert it<br> +---* to an enumeration value. If it matches to one of the predefined strings, it will create a<br> +---* callback to get the correct value at runtime.<br> +---* param uniformName The name of the material parameter to store an auto-binding for.<br> +---* param autoBinding A string matching one of the built-in AutoBinding enum constants. +---@param uniformName string +---@param autoBinding string +---@return cc.backend.ProgramState +function ProgramState:setParameterAutoBinding (uniformName,autoBinding) end +---* Get the program object. +---@return cc.backend.Program +function ProgramState:getProgram () end +---@overload fun(string0:int):self +---@overload fun(string:string):self +---@param name string +---@return int +function ProgramState:getAttributeLocation (name) end +---* param program Specifies the program. +---@param program cc.backend.Program +---@return cc.backend.ProgramState +function ProgramState:ProgramState (program) end
\ No newline at end of file diff --git a/meta/3rd/Cocos4.0/library/ccb/Texture2DBackend.lua b/meta/3rd/Cocos4.0/library/ccb/Texture2DBackend.lua new file mode 100644 index 00000000..a06988b7 --- /dev/null +++ b/meta/3rd/Cocos4.0/library/ccb/Texture2DBackend.lua @@ -0,0 +1,73 @@ +---@meta + +---@class ccb.Texture2DBackend :ccb.TextureBackend +local Texture2DBackend={ } +ccb.Texture2DBackend=Texture2DBackend + + + + +---* Get texture height.<br> +---* return Texture height. +---@return unsigned_int +function Texture2DBackend:getHeight () end +---* Get texture width.<br> +---* return Texture width. +---@return unsigned_int +function Texture2DBackend:getWidth () end +---* Update a two-dimensional texture image<br> +---* param data Specifies a pointer to the image data in memory.<br> +---* param width Specifies the width of the texture image.<br> +---* param height Specifies the height of the texture image.<br> +---* param level Specifies the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. +---@param data unsigned_char +---@param width unsigned_int +---@param height unsigned_int +---@param level unsigned_int +---@return cc.backend.Texture2DBackend +function Texture2DBackend:updateData (data,width,height,level) end +---* Update a two-dimensional texture image in a compressed format<br> +---* param data Specifies a pointer to the compressed image data in memory.<br> +---* param width Specifies the width of the texture image.<br> +---* param height Specifies the height of the texture image.<br> +---* param dataLen Specifies the totoal size of compressed image in bytes.<br> +---* param level Specifies the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. +---@param data unsigned_char +---@param width unsigned_int +---@param height unsigned_int +---@param dataLen unsigned_int +---@param level unsigned_int +---@return cc.backend.Texture2DBackend +function Texture2DBackend:updateCompressedData (data,width,height,dataLen,level) end +---* Update a two-dimensional texture subimage<br> +---* param xoffset Specifies a texel offset in the x direction within the texture array.<br> +---* param yoffset Specifies a texel offset in the y direction within the texture array.<br> +---* param width Specifies the width of the texture subimage.<br> +---* param height Specifies the height of the texture subimage.<br> +---* param level Specifies the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image.<br> +---* param data Specifies a pointer to the image data in memory. +---@param xoffset unsigned_int +---@param yoffset unsigned_int +---@param width unsigned_int +---@param height unsigned_int +---@param level unsigned_int +---@param data unsigned_char +---@return cc.backend.Texture2DBackend +function Texture2DBackend:updateSubData (xoffset,yoffset,width,height,level,data) end +---* Update a two-dimensional texture subimage in a compressed format<br> +---* param xoffset Specifies a texel offset in the x direction within the texture array.<br> +---* param yoffset Specifies a texel offset in the y direction within the texture array.<br> +---* param width Specifies the width of the texture subimage.<br> +---* param height Specifies the height of the texture subimage.<br> +---* param dataLen Specifies the totoal size of compressed subimage in bytes.<br> +---* param level Specifies the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image.<br> +---* param data Specifies a pointer to the compressed image data in memory. +---@param xoffset unsigned_int +---@param yoffset unsigned_int +---@param width unsigned_int +---@param height unsigned_int +---@param dataLen unsigned_int +---@param level unsigned_int +---@param data unsigned_char +---@return cc.backend.Texture2DBackend +function Texture2DBackend:updateCompressedSubData (xoffset,yoffset,width,height,dataLen,level,data) end
\ No newline at end of file diff --git a/meta/3rd/Cocos4.0/library/ccb/TextureBackend.lua b/meta/3rd/Cocos4.0/library/ccb/TextureBackend.lua new file mode 100644 index 00000000..e880e7cd --- /dev/null +++ b/meta/3rd/Cocos4.0/library/ccb/TextureBackend.lua @@ -0,0 +1,51 @@ +---@meta + +---@class ccb.TextureBackend :cc.Ref +local TextureBackend={ } +ccb.TextureBackend=TextureBackend + + + + +---* Get texture format.<br> +---* return Texture format. +---@return int +function TextureBackend:getTextureFormat () end +---* Get texture type. Symbolic constant value can be either TEXTURE_2D or TEXTURE_CUBE.<br> +---* return Texture type. +---@return int +function TextureBackend:getTextureType () end +---* Update sampler<br> +---* param sampler Specifies the sampler descriptor. +---@param sampler cc.backend.SamplerDescriptor +---@return cc.backend.TextureBackend +function TextureBackend:updateSamplerDescriptor (sampler) end +---* Update texture description.<br> +---* param descriptor Specifies texture and sampler descriptor. +---@param descriptor cc.backend.TextureDescriptor +---@return cc.backend.TextureBackend +function TextureBackend:updateTextureDescriptor (descriptor) end +---* Get texture usage. Symbolic constant can be READ, WRITE or RENDER_TARGET.<br> +---* return Texture usage. +---@return int +function TextureBackend:getTextureUsage () end +---* Check if mipmap had generated before.<br> +---* return true if the mipmap has always generated before, otherwise false. +---@return boolean +function TextureBackend:hasMipmaps () end +---* / Generate mipmaps. +---@return cc.backend.TextureBackend +function TextureBackend:generateMipmaps () end +---* Read a block of pixels from the drawable texture<br> +---* param x,y Specify the window coordinates of the first pixel that is read from the drawable texture. This location is the lower left corner of a rectangular block of pixels.<br> +---* param width,height Specify the dimensions of the pixel rectangle. width and height of one correspond to a single pixel.<br> +---* param flipImage Specifies if needs to flip the image.<br> +---* param callback Specifies a call back function to deal with the image. +---@param x unsigned_int +---@param y unsigned_int +---@param width unsigned_int +---@param height unsigned_int +---@param flipImage boolean +---@param callback function +---@return cc.backend.TextureBackend +function TextureBackend:getBytes (x,y,width,height,flipImage,callback) end
\ No newline at end of file diff --git a/meta/3rd/Cocos4.0/library/ccb/TextureCubemapBackend.lua b/meta/3rd/Cocos4.0/library/ccb/TextureCubemapBackend.lua new file mode 100644 index 00000000..ff64c23c --- /dev/null +++ b/meta/3rd/Cocos4.0/library/ccb/TextureCubemapBackend.lua @@ -0,0 +1,16 @@ +---@meta + +---@class ccb.TextureCubemapBackend :ccb.TextureBackend +local TextureCubemapBackend={ } +ccb.TextureCubemapBackend=TextureCubemapBackend + + + + +---* Update texutre cube data in give slice side.<br> +---* param side Specifies which slice texture of cube to be update.<br> +---* param data Specifies a pointer to the image data in memory. +---@param side int +---@param data void +---@return cc.backend.TextureCubemapBackend +function TextureCubemapBackend:updateFaceData (side,data) end
\ No newline at end of file diff --git a/meta/3rd/Cocos4.0/library/ccb/VertexLayout.lua b/meta/3rd/Cocos4.0/library/ccb/VertexLayout.lua new file mode 100644 index 00000000..2c379aa1 --- /dev/null +++ b/meta/3rd/Cocos4.0/library/ccb/VertexLayout.lua @@ -0,0 +1,42 @@ +---@meta + +---@class ccb.VertexLayout +local VertexLayout={ } +ccb.VertexLayout=VertexLayout + + + + +---* Get vertex step function. Default value is VERTEX.<br> +---* return Vertex step function.<br> +---* note Used in metal. +---@return int +function VertexLayout:getVertexStepMode () end +---* Check if vertex layout has been set. +---@return boolean +function VertexLayout:isValid () end +---* Set stride of vertices.<br> +---* param stride Specifies the distance between the data of two vertices, in bytes. +---@param stride unsigned_int +---@return cc.backend.VertexLayout +function VertexLayout:setLayout (stride) end +---* Set attribute values to name.<br> +---* param name Specifies the attribute name.<br> +---* param index Specifies the index of the generic vertex attribute to be modified.<br> +---* param format Specifies how the vertex attribute data is laid out in memory.<br> +---* param offset Specifies the byte offset to the first component of the first generic vertex attribute.<br> +---* param needToBeNormallized Specifies whether fixed-point data values should be normalized (true) or converted directly as fixed-point values (false) when they are accessed. +---@param name string +---@param index unsigned_int +---@param format int +---@param offset unsigned_int +---@param needToBeNormallized boolean +---@return cc.backend.VertexLayout +function VertexLayout:setAttribute (name,index,format,offset,needToBeNormallized) end +---* Get the distance between the data of two vertices, in bytes.<br> +---* return The distance between the data of two vertices, in bytes. +---@return unsigned_int +function VertexLayout:getStride () end +---* +---@return cc.backend.VertexLayout +function VertexLayout:VertexLayout () end
\ No newline at end of file |