From 7b64e45f67a8fb173a64588fe57f32e1fda7bfbf Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Sun, 12 Jan 2025 14:42:34 -0800 Subject: [PATCH] Fix boolean handling in GL query result check. --- src/classes/gl.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 => { -- 2.34.1