From 60f03e3c5e5d19a27eff0bb02b5995352767492b Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 31 Oct 2018 15:05:06 +0100 Subject: view/tile: fix vertex count --- src/view/tile.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/view/tile.ts b/src/view/tile.ts index d748ec9..3dd7231 100644 --- a/src/view/tile.ts +++ b/src/view/tile.ts @@ -31,7 +31,7 @@ export class TileViewBuilder { } export class TileView { - private readonly primitiveCount: number; + private readonly vertexCount: number; private readonly vertexBuffer: WebGLBuffer; private readonly textureBuffer: WebGLBuffer; @@ -51,7 +51,7 @@ export class TileView { gl.bindBuffer(gl.ARRAY_BUFFER, this.textureBuffer); gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(textureData), gl.STATIC_DRAW); - this.primitiveCount = vertexData.length / 3; + this.vertexCount = vertexData.length / 2; } public render(): void { @@ -69,6 +69,6 @@ export class TileView { gl.bindBuffer(gl.ARRAY_BUFFER, this.textureBuffer); gl.vertexAttribPointer(this.r.getTextureCoordLoc(), 2, gl.FLOAT, false, 0, 0); - gl.drawArrays(gl.TRIANGLES, 0, this.primitiveCount); + gl.drawArrays(gl.TRIANGLES, 0, this.vertexCount); } } -- cgit v1.2.3