From: Chris Duncan Date: Sun, 12 Jan 2025 22:42:34 +0000 (-0800) Subject: Fix boolean handling in GL query result check. X-Git-Tag: v1.2.0~8 X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=7b64e45f67a8fb173a64588fe57f32e1fda7bfbf;p=nano-pow.git Fix boolean handling in GL query result check. --- diff --git a/src/classes/gl.ts b/src/classes/gl.ts index 253c4a0..1b190da 100644 --- a/src/classes/gl.ts +++ b/src/classes/gl.ts @@ -118,7 +118,7 @@ export class NanoPowGl { static async #checkQueryResult (): Promise { if (this.#gl == null || this.#query == null) throw new Error('WebGL 2 is required to check query results') if (this.#gl.getQueryParameter(this.#query, this.#gl.QUERY_RESULT_AVAILABLE)) { - return this.#gl.getQueryParameter(this.#query, this.#gl.QUERY_RESULT) + return !!(this.#gl.getQueryParameter(this.#query, this.#gl.QUERY_RESULT)) } /** Query result not yet available, check again in the next frame */ return new Promise((resolve, reject): void => {