summaryrefslogtreecommitdiffstats
path: root/src/view
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2018-10-23 23:45:30 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2018-10-23 23:45:30 +0200
commitf9f3da7048880cb3c4b03d0116bb8be850688e74 (patch)
tree9077dfd9e2e8bf56896d9a4e00d3c59843091f1f /src/view
parent02758a69ac49cc437ed27628b64e08fd443758b8 (diff)
downloadrpgedit-f9f3da7048880cb3c4b03d0116bb8be850688e74.tar
rpgedit-f9f3da7048880cb3c4b03d0116bb8be850688e74.zip
Update everything
Diffstat (limited to 'src/view')
-rw-r--r--src/view/Renderer.ts18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/view/Renderer.ts b/src/view/Renderer.ts
index 1b9dd84..f1b7bac 100644
--- a/src/view/Renderer.ts
+++ b/src/view/Renderer.ts
@@ -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);