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"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/gl-matrix": "^2.3.0",
|
||||
"@types/lodash": "^4.14.74",
|
||||
"@types/gl-matrix": "^2.4.4",
|
||||
"@types/lodash": "^4.14.117",
|
||||
"raw-loader": "^0.5.1",
|
||||
"ts-loader": "^2.3.6",
|
||||
"typescript": "^2.5.2",
|
||||
"uglifyjs-webpack-plugin": "^0.4.6",
|
||||
"webpack": "^3.5.6",
|
||||
"webpack-dev-server": "^2.7.1"
|
||||
"ts-loader": "^5.2.2",
|
||||
"typescript": "^3.1.3",
|
||||
"uglifyjs-webpack-plugin": "^2.0.1",
|
||||
"webpack": "^4.22.0",
|
||||
"webpack-cli": "^3.1.2",
|
||||
"webpack-dev-server": "^3.1.10"
|
||||
},
|
||||
"dependencies": {
|
||||
"gl-matrix": "^2.4.0",
|
||||
"lodash": "^4.17.4"
|
||||
"gl-matrix": "^2.8.1",
|
||||
"lodash": "^4.17.11"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,14 +1,18 @@
|
|||
import {mat4} from 'gl-matrix';
|
||||
|
||||
|
||||
import vertexShaderSrc from './default.vs';
|
||||
import fragmentShaderSrc from './default.fs';
|
||||
|
||||
|
||||
export default class Renderer {
|
||||
public gl: WebGLRenderingContext;
|
||||
|
||||
public vertexPosLoc: number;
|
||||
public textureCoordLoc: number;
|
||||
private viewportLoc: WebGLUniformLocation;
|
||||
private translateLoc: WebGLUniformLocation;
|
||||
public samplerLoc: WebGLUniformLocation;
|
||||
public vertexPosLoc!: number;
|
||||
public textureCoordLoc!: number;
|
||||
private viewportLoc!: WebGLUniformLocation;
|
||||
private translateLoc!: WebGLUniformLocation;
|
||||
public samplerLoc!: WebGLUniformLocation;
|
||||
|
||||
private viewport: mat4 = mat4.create();
|
||||
|
||||
|
@ -66,8 +70,8 @@ export default class Renderer {
|
|||
if (!shaderProgram)
|
||||
throw new Error('Unable to create shader program');
|
||||
|
||||
let vertexShader = this.compileShader(this.gl.VERTEX_SHADER, require('./default.vs'));
|
||||
let fragmentShader = this.compileShader(this.gl.FRAGMENT_SHADER, require('./default.fs'));
|
||||
let vertexShader = this.compileShader(this.gl.VERTEX_SHADER, vertexShaderSrc);
|
||||
let fragmentShader = this.compileShader(this.gl.FRAGMENT_SHADER, fragmentShaderSrc);
|
||||
|
||||
|
||||
this.gl.attachShader(shaderProgram, vertexShader);
|
||||
|
|
|
@ -2,9 +2,7 @@
|
|||
"compilerOptions": {
|
||||
"outDir": "./dist/",
|
||||
"sourceMap": true,
|
||||
"module": "commonjs",
|
||||
"target": "ES2015",
|
||||
"lib": [ "es2015", "dom" ],
|
||||
"strict": true
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue