Skip to content

Commit

Permalink
refactor(webgl): add type hints (TS 3.6.4)
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Oct 13, 2019
1 parent a1582c0 commit bd01c79
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/webgl/src/checks.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ITexture, TextureType } from "./api/texture";

export const isGL2Context = (
gl: WebGLRenderingContext
gl: WebGLRenderingContext | WebGL2RenderingContext
): gl is WebGL2RenderingContext =>
typeof WebGL2RenderingContext !== "undefined" &&
gl instanceof WebGL2RenderingContext;
Expand Down
7 changes: 5 additions & 2 deletions packages/webgl/src/multipass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from "@thi.ng/transducers";
import { ExtensionBehaviors } from "./api/ext";
import { Multipass, MultipassOpts, PassOpts } from "./api/multipass";
import { ShaderSpec, ShaderUniformSpecs } from "./api/shader";
import { ShaderOutputSpec, ShaderSpec, ShaderUniformSpecs } from "./api/shader";
import { ITexture } from "./api/texture";
import { compileModel } from "./buffer";
import { isFloatTexture, isGL2Context } from "./checks";
Expand Down Expand Up @@ -46,7 +46,10 @@ export const multipass = (opts: MultipassOpts) => {
},
outputs: numOuts
? transduce(
map((i) => [`output${i}`, ["vec4", i]]),
map<number, [string, ShaderOutputSpec]>((i) => [
`output${i}`,
["vec4", i]
]),
assocObj(),
range(numOuts)
)
Expand Down

0 comments on commit bd01c79

Please sign in to comment.