diff options
author | Ilion Beyst <ilion.beyst@gmail.com> | 2022-07-18 21:02:27 +0200 |
---|---|---|
committer | Ilion Beyst <ilion.beyst@gmail.com> | 2022-07-18 21:02:27 +0200 |
commit | d092f5d89c0fda5cc67349d5489b4ef1b294e053 (patch) | |
tree | c630cd90c358101e700fcf76011d84a63957aa31 /web/pw-visualizer/src/webgl/text.ts | |
parent | 6e494aca463b8632fe2b78ee89b8651187f8061a (diff) | |
download | planetwars.dev-d092f5d89c0fda5cc67349d5489b4ef1b294e053.tar.xz planetwars.dev-d092f5d89c0fda5cc67349d5489b4ef1b294e053.zip |
use texture for rendering ships
Diffstat (limited to 'web/pw-visualizer/src/webgl/text.ts')
-rw-r--r-- | web/pw-visualizer/src/webgl/text.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/web/pw-visualizer/src/webgl/text.ts b/web/pw-visualizer/src/webgl/text.ts index cb72a42..1ae6f37 100644 --- a/web/pw-visualizer/src/webgl/text.ts +++ b/web/pw-visualizer/src/webgl/text.ts @@ -33,8 +33,8 @@ export class LabelFactory { font: FontInfo; shader: Shader; - constructor(gl: WebGLRenderingContext, loc: string, font: FontInfo, shader: Shader) { - this.texture = Texture.fromImage(gl, loc, 'font'); + constructor(gl: WebGLRenderingContext, fontTexture: Texture, font: FontInfo, shader: Shader) { + this.texture = fontTexture; this.font = font; this.shader = shader; } @@ -144,7 +144,7 @@ export class Label { } } -export function defaultLabelFactory(gl: WebGLRenderingContext, shader: Shader): LabelFactory { +export function defaultLabelFactory(gl: WebGLRenderingContext, fontTexture: Texture, shader: Shader): LabelFactory { const fontInfo = { letterHeight: 8, spaceWidth: 8, @@ -195,5 +195,5 @@ export function defaultLabelFactory(gl: WebGLRenderingContext, shader: Shader): }, }; - return new LabelFactory(gl, fontPng, fontInfo, shader); + return new LabelFactory(gl, fontTexture, fontInfo, shader); } |