Skip to content

Commit

Permalink
fix: make compatible with TypeScript 4.3
Browse files Browse the repository at this point in the history
In TypeScript 4.3, `WebGLObject` was dropped from `lib.dom.d.ts`.
This commit replaces uses of `WebGLObject` with `WebGLRenderbuffer|WebGLTexture`.
Based on reading TWGL's `createFramebufferInfo(...)` these two are the
only possible object types for attachments in `FramebufferInfo`.
  • Loading branch information
drola committed Jul 12, 2021
1 parent 0a44471 commit fc82632
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/framebuffers.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const LINEAR = 0x2601;
* @property {number} [level] level for `gl.framebufferTexture2D`. Defaults to 0.
* @property {number} [layer] layer for `gl.framebufferTextureLayer`. Defaults to undefined.
* If set then `gl.framebufferTextureLayer` is called, if not then `gl.framebufferTexture2D`
* @property {WebGLObject} [attachment] An existing renderbuffer or texture.
* @property {WebGLRenderbuffer|WebGLTexture} [attachment] An existing renderbuffer or texture.
* If provided will attach this Object. This allows you to share
* attachments across framebuffers.
* @memberOf module:twgl
Expand Down Expand Up @@ -137,7 +137,7 @@ function isRenderbufferFormat(format) {
/**
* @typedef {Object} FramebufferInfo
* @property {WebGLFramebuffer} framebuffer The WebGLFramebuffer for this framebufferInfo
* @property {WebGLObject[]} attachments The created attachments in the same order as passed in to {@link module:twgl.createFramebufferInfo}.
* @property {(WebGLRenderbuffer|WebGLTexture)[]} attachments The created attachments in the same order as passed in to {@link module:twgl.createFramebufferInfo}.
* @property {number} width The width of the framebuffer and its attachments
* @property {number} height The width of the framebuffer and its attachments
* @memberOf module:twgl
Expand Down

0 comments on commit fc82632

Please sign in to comment.