Skip to content

Commit

Permalink
update dependencies; fix build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
flyover committed Jun 15, 2019
1 parent 53f9ece commit 593790c
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 7 deletions.
2 changes: 1 addition & 1 deletion demo/dist/demo/atlas.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion demo/dist/demo/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion demo/dist/demo/render-ctx2d.js

Large diffs are not rendered by default.

17 changes: 16 additions & 1 deletion demo/dist/demo/render-webgl.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion demo/dist/spine.js

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions demo/render-webgl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,7 @@ export function mat4x4ApplyAtlasSitePosition(m: Float32Array, site: Atlas.Site |

export function glCompileShader(gl: WebGLRenderingContext, src: string[], type: number): WebGLShader | null {
let shader: WebGLShader | null = gl.createShader(type);
if (shader === null) { return null; }
gl.shaderSource(shader, src.join("\n"));
gl.compileShader(shader);
if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
Expand All @@ -866,7 +867,9 @@ export function glCompileShader(gl: WebGLRenderingContext, src: string[], type:
}

export function glLinkProgram(gl: WebGLRenderingContext, vs: WebGLShader | null, fs: WebGLShader | null): WebGLProgram | null {
if (vs === null || fs === null) { return null; }
let program: WebGLProgram | null = gl.createProgram();
if (program === null) { return null; }
gl.attachShader(program, vs);
gl.attachShader(program, fs);
gl.linkProgram(program);
Expand All @@ -881,6 +884,7 @@ export function glLinkProgram(gl: WebGLRenderingContext, vs: WebGLShader | null,
}

export function glGetUniforms(gl: WebGLRenderingContext, program: WebGLProgram | null, uniforms: Map<string, WebGLUniformLocation> = new Map<string, WebGLUniformLocation>()): Map<string, WebGLUniformLocation> {
if (program === null) { return uniforms; }
const count: number = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS);
for (let index: number = 0; index < count; ++index) {
const uniform: WebGLActiveInfo | null = gl.getActiveUniform(program, index);
Expand All @@ -893,6 +897,7 @@ export function glGetUniforms(gl: WebGLRenderingContext, program: WebGLProgram |
}

export function glGetAttribs(gl: WebGLRenderingContext, program: WebGLProgram | null, attribs: Map<string, number> = new Map<string, number>()): Map<string, number> {
if (program === null) { return attribs; }
const count: number = gl.getProgramParameter(program, gl.ACTIVE_ATTRIBUTES);
for (let index: number = 0; index < count; ++index) {
const attrib: WebGLActiveInfo | null = gl.getActiveAttrib(program, index);
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"dependencies": {
"@types/systemjs": "^0.20.6",
"plugin-typescript": "^8.0.0",
"systemjs": "^0.21.3",
"typescript": "^2.8.3"
"systemjs": "^0.21.6",
"typescript": "^3.5.2"
},
"devDependencies": {},
"scripts": {
Expand Down

0 comments on commit 593790c

Please sign in to comment.