Update everything
This commit is contained in:
parent
02758a69ac
commit
f9f3da7048
6 changed files with 3846 additions and 3662 deletions
10
custom.d.ts
vendored
10
custom.d.ts
vendored
|
@ -1 +1,9 @@
|
||||||
declare function require(name: string): string;
|
declare module "*.vs" {
|
||||||
|
const content: string;
|
||||||
|
export default content;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module "*.fs" {
|
||||||
|
const content: string;
|
||||||
|
export default content;
|
||||||
|
}
|
||||||
|
|
3643
package-lock.json
generated
3643
package-lock.json
generated
File diff suppressed because it is too large
Load diff
19
package.json
19
package.json
|
@ -5,17 +5,18 @@
|
||||||
"build": "webpack"
|
"build": "webpack"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/gl-matrix": "^2.3.0",
|
"@types/gl-matrix": "^2.4.4",
|
||||||
"@types/lodash": "^4.14.74",
|
"@types/lodash": "^4.14.117",
|
||||||
"raw-loader": "^0.5.1",
|
"raw-loader": "^0.5.1",
|
||||||
"ts-loader": "^2.3.6",
|
"ts-loader": "^5.2.2",
|
||||||
"typescript": "^2.5.2",
|
"typescript": "^3.1.3",
|
||||||
"uglifyjs-webpack-plugin": "^0.4.6",
|
"uglifyjs-webpack-plugin": "^2.0.1",
|
||||||
"webpack": "^3.5.6",
|
"webpack": "^4.22.0",
|
||||||
"webpack-dev-server": "^2.7.1"
|
"webpack-cli": "^3.1.2",
|
||||||
|
"webpack-dev-server": "^3.1.10"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"gl-matrix": "^2.4.0",
|
"gl-matrix": "^2.8.1",
|
||||||
"lodash": "^4.17.4"
|
"lodash": "^4.17.11"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,18 @@
|
||||||
import {mat4} from 'gl-matrix';
|
import {mat4} from 'gl-matrix';
|
||||||
|
|
||||||
|
|
||||||
|
import vertexShaderSrc from './default.vs';
|
||||||
|
import fragmentShaderSrc from './default.fs';
|
||||||
|
|
||||||
|
|
||||||
export default class Renderer {
|
export default class Renderer {
|
||||||
public gl: WebGLRenderingContext;
|
public gl: WebGLRenderingContext;
|
||||||
|
|
||||||
public vertexPosLoc: number;
|
public vertexPosLoc!: number;
|
||||||
public textureCoordLoc: number;
|
public textureCoordLoc!: number;
|
||||||
private viewportLoc: WebGLUniformLocation;
|
private viewportLoc!: WebGLUniformLocation;
|
||||||
private translateLoc: WebGLUniformLocation;
|
private translateLoc!: WebGLUniformLocation;
|
||||||
public samplerLoc: WebGLUniformLocation;
|
public samplerLoc!: WebGLUniformLocation;
|
||||||
|
|
||||||
private viewport: mat4 = mat4.create();
|
private viewport: mat4 = mat4.create();
|
||||||
|
|
||||||
|
@ -66,8 +70,8 @@ export default class Renderer {
|
||||||
if (!shaderProgram)
|
if (!shaderProgram)
|
||||||
throw new Error('Unable to create shader program');
|
throw new Error('Unable to create shader program');
|
||||||
|
|
||||||
let vertexShader = this.compileShader(this.gl.VERTEX_SHADER, require('./default.vs'));
|
let vertexShader = this.compileShader(this.gl.VERTEX_SHADER, vertexShaderSrc);
|
||||||
let fragmentShader = this.compileShader(this.gl.FRAGMENT_SHADER, require('./default.fs'));
|
let fragmentShader = this.compileShader(this.gl.FRAGMENT_SHADER, fragmentShaderSrc);
|
||||||
|
|
||||||
|
|
||||||
this.gl.attachShader(shaderProgram, vertexShader);
|
this.gl.attachShader(shaderProgram, vertexShader);
|
||||||
|
|
|
@ -2,9 +2,7 @@
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "./dist/",
|
"outDir": "./dist/",
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"module": "commonjs",
|
|
||||||
"target": "ES2015",
|
"target": "ES2015",
|
||||||
"lib": [ "es2015", "dom" ],
|
|
||||||
"strict": true
|
"strict": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue