1 Star 0 Fork 73

bsn2oschina / ccfish

forked from 子龙缘 / ccfish 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
global.d.ts 2.15 KB
一键复制 编辑 原始数据 按行查看 历史
declare module cc {
/**
* 实现WebGL program的类,用来做shader编程
*/
export class GLProgram{
/**
* 实现WebGL program的类,用来做shader编程
*/
constructor();
/**
* 使用顶点shader字符串和片段shader字符串初始化cc.GLProgram
* @param vertShaderStr 顶点shader字符串
* @param fragShaderStr 片段shader字符串
*/
initWithString(vertShaderStr: string, fragShaderStr: string): boolean;
/**
* It will add a new attribute to the shader
* @param attributeName
* @param index
*/
addAttribute(attributeName: number, index: number);
/**
* Initializes the cc.GLProgram with a vertex and fragment with string
* @param vertShaderStr
* @param fragShaderStr
*/
initWithVertexShaderByteArray(vertShaderStr: string, fragShaderStr: string):boolean;
/**
* 连接 glprogram
*/
link(): boolean;
/**
* 这个函数创建4个统一变量即uniform
* cc.macro.UNIFORM_PMATRIX
* cc.macro.UNIFORM_MVMATRIX
* cc.macro.UNIFORM_MVPMATRIX
* cc.macro.UNIFORM_SAMPLER
*/
updateUniforms();
/**
* it will call gl.useProgram()
*/
use();
/**
* calls retrieves the named uniform location for this shader program.
* @param name
*/
getUniformLocationForName(name: string): number;
/**
* calls glUniform1f only if the values are different than the previous call for this same shader program.
* @param location
* @param f1
*/
setUniformLocationWith1f(location, f1);
/**
* calls glUniform2f only if the values are different than the previous call for this same shader program.
* @param location
* @param f1
* @param f2
*/
setUniformLocationWith2f(location,f1,f2)
}
export class GLProgramState{
static getOrCreateWithGLProgram(program:GLProgram):any;
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
TypeScript
1
https://gitee.com/bsn/ccfish.git
git@gitee.com:bsn/ccfish.git
bsn
ccfish
ccfish
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891