]> zoso.dev Git - nano-pow.git/commitdiff
Fix boolean handling in GL query result check.
authorChris Duncan <chris@zoso.dev>
Sun, 12 Jan 2025 22:42:34 +0000 (14:42 -0800)
committerChris Duncan <chris@zoso.dev>
Sun, 12 Jan 2025 22:42:34 +0000 (14:42 -0800)
src/classes/gl.ts

index 253c4a0727ecacd93d63677b1f6f9a8c0954330a..1b190da9ba0080e8dfbb2663d638ccf7fd00f541 100644 (file)
@@ -118,7 +118,7 @@ export class NanoPowGl {
        static async #checkQueryResult (): Promise<boolean> {
                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 => {