2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
|
|
|
-- @module GLProgram
|
2014-03-20 10:21:28 +08:00
|
|
|
-- @extend Ref
|
2014-06-25 17:36:50 +08:00
|
|
|
-- @parent_module cc
|
2014-03-18 15:55:30 +08:00
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- returns the fragmentShader error log
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#GLProgram] getFragmentShaderLog
|
|
|
|
-- @param self
|
|
|
|
-- @return string#string ret (return value: string)
|
|
|
|
|
|
|
|
--------------------------------
|
2015-05-06 09:07:26 +08:00
|
|
|
-- @overload self, char, char, string
|
|
|
|
-- @overload self, char, char
|
|
|
|
-- @function [parent=#GLProgram] initWithByteArrays
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #char vShaderByteArray
|
|
|
|
-- @param #char fShaderByteArray
|
2015-05-06 09:07:26 +08:00
|
|
|
-- @param #string compileTimeDefines
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @return bool#bool ret (return value: bool)
|
2015-05-06 09:07:26 +08:00
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2015-05-06 09:07:26 +08:00
|
|
|
-- @overload self, string, string, string
|
|
|
|
-- @overload self, string, string
|
|
|
|
-- @function [parent=#GLProgram] initWithFilenames
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #string vShaderFilename
|
|
|
|
-- @param #string fShaderFilename
|
2015-05-06 09:07:26 +08:00
|
|
|
-- @param #string compileTimeDefines
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @return bool#bool ret (return value: bool)
|
2015-05-06 09:07:26 +08:00
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- it will call glUseProgram()
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#GLProgram] use
|
|
|
|
-- @param self
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return GLProgram#GLProgram self (return value: cc.GLProgram)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- returns the vertexShader error log
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#GLProgram] getVertexShaderLog
|
|
|
|
-- @param self
|
|
|
|
-- @return string#string ret (return value: string)
|
|
|
|
|
|
|
|
--------------------------------
|
2014-07-17 10:28:34 +08:00
|
|
|
-- @overload self, mat4_table
|
|
|
|
-- @overload self
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#GLProgram] setUniformsForBuiltins
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #mat4_table modelView
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return GLProgram#GLProgram self (return value: cc.GLProgram)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- It will create 4 uniforms:<br>
|
|
|
|
-- - kUniformPMatrix<br>
|
|
|
|
-- - kUniformMVMatrix<br>
|
|
|
|
-- - kUniformMVPMatrix<br>
|
|
|
|
-- - GLProgram::UNIFORM_SAMPLER<br>
|
|
|
|
-- And it will bind "GLProgram::UNIFORM_SAMPLER" to 0
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#GLProgram] updateUniforms
|
|
|
|
-- @param self
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return GLProgram#GLProgram self (return value: cc.GLProgram)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-04-21 18:29:17 +08:00
|
|
|
-- calls glUniform1i only if the values are different than the previous call for this same shader program.<br>
|
2014-09-02 13:45:07 +08:00
|
|
|
-- js setUniformLocationI32<br>
|
|
|
|
-- lua setUniformLocationI32
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#GLProgram] setUniformLocationWith1i
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #int location
|
|
|
|
-- @param #int i1
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return GLProgram#GLProgram self (return value: cc.GLProgram)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-03-20 12:53:00 +08:00
|
|
|
-- Reload all shaders, this function is designed for android<br>
|
|
|
|
-- when opengl context lost, so don't call it.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#GLProgram] reset
|
|
|
|
-- @param self
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return GLProgram#GLProgram self (return value: cc.GLProgram)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-03-20 12:53:00 +08:00
|
|
|
-- It will add a new attribute to the shader by calling glBindAttribLocation.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#GLProgram] bindAttribLocation
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #string attributeName
|
|
|
|
-- @param #unsigned int index
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return GLProgram#GLProgram self (return value: cc.GLProgram)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-03-20 12:53:00 +08:00
|
|
|
-- Calls glGetAttribLocation.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#GLProgram] getAttribLocation
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #string attributeName
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @return int#int ret (return value: int)
|
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- links the glProgram
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#GLProgram] link
|
|
|
|
-- @param self
|
|
|
|
-- @return bool#bool ret (return value: bool)
|
|
|
|
|
2014-05-10 11:47:56 +08:00
|
|
|
--------------------------------
|
2015-05-06 09:07:26 +08:00
|
|
|
-- @overload self, char, char, string
|
|
|
|
-- @overload self, char, char
|
|
|
|
-- @function [parent=#GLProgram] createWithByteArrays
|
2014-05-10 11:47:56 +08:00
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #char vShaderByteArray
|
|
|
|
-- @param #char fShaderByteArray
|
2015-05-06 09:07:26 +08:00
|
|
|
-- @param #string compileTimeDefines
|
2014-05-10 11:47:56 +08:00
|
|
|
-- @return GLProgram#GLProgram ret (return value: cc.GLProgram)
|
2015-05-06 09:07:26 +08:00
|
|
|
|
2014-05-10 11:47:56 +08:00
|
|
|
--------------------------------
|
2015-05-06 09:07:26 +08:00
|
|
|
-- @overload self, string, string, string
|
|
|
|
-- @overload self, string, string
|
|
|
|
-- @function [parent=#GLProgram] createWithFilenames
|
2014-05-10 11:47:56 +08:00
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #string vShaderFilename
|
|
|
|
-- @param #string fShaderFilename
|
2015-05-06 09:07:26 +08:00
|
|
|
-- @param #string compileTimeDefines
|
2014-05-10 11:47:56 +08:00
|
|
|
-- @return GLProgram#GLProgram ret (return value: cc.GLProgram)
|
2015-05-06 09:07:26 +08:00
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2015-03-20 12:53:00 +08:00
|
|
|
-- Constructor.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#GLProgram] GLProgram
|
|
|
|
-- @param self
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return GLProgram#GLProgram self (return value: cc.GLProgram)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
return nil
|