From 52a705ac02e27c4589cdb84ef74a781787bcdbe5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bel=C3=A9n=20Albeza?= Date: Mon, 25 Nov 2024 16:13:29 +0100 Subject: [PATCH] :sparkles: Add config flag for DPR --- frontend/src/app/render_wasm/api.cljs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/render_wasm/api.cljs b/frontend/src/app/render_wasm/api.cljs index bc9adad332..d55cbe64a4 100644 --- a/frontend/src/app/render_wasm/api.cljs +++ b/frontend/src/app/render_wasm/api.cljs @@ -16,6 +16,7 @@ (defonce internal-frame-id nil) (defonce internal-module #js {}) +(defonce use-dpr? (contains? cf/flags :render-wasm-dpr)) ;; This should never be called from the outside. ;; This function receives a "time" parameter that we're not using but maybe in the future could be useful (it is the time since @@ -182,7 +183,7 @@ [canvas] (let [gl (unchecked-get internal-module "GL") context (.getContext ^js canvas "webgl2" canvas-options) - dpr js/window.devicePixelRatio + dpr (when use-dpr? js/window.devicePixelRatio) ;; Register the context with emscripten handle (.registerContext ^js gl context #js {"majorVersion" 2})]