diff --git a/elm-patches/Makefile b/elm-patches/Makefile index 833b2038..ccb8ec2a 100644 --- a/elm-patches/Makefile +++ b/elm-patches/Makefile @@ -1,4 +1,4 @@ -all: VirtualDom Url Browser +all: VirtualDom Url Browser WebGL VirtualDom: rm -f ~/.elm/0.19.1/packages/elm/virtual-dom/1.0.3/artifacts.dat @@ -13,4 +13,9 @@ Url: Browser: rm -f ~/.elm/0.19.1/packages/elm/browser/1.0.2/artifacts.dat rm -f ~/.elm/0.19.1/packages/elm/browser/1.0.2/docs.json - patch -uN --no-backup-if-mismatch --reject-file=/tmp/rej ~/.elm/0.19.1/packages/elm/browser/1.0.2/src/Elm/Kernel/Browser.js ./PatchBrowserForFlipAnimations.patch || true \ No newline at end of file + patch -uN --no-backup-if-mismatch --reject-file=/tmp/rej ~/.elm/0.19.1/packages/elm/browser/1.0.2/src/Elm/Kernel/Browser.js ./PatchBrowserForFlipAnimations.patch || true + +WebGL: + rm -f ~/.elm/0.19.1/packages/elm-explorations/webgl/1.1.3/artifacts.dat + rm -f ~/.elm/0.19.1/packages/elm-explorations/webgl/1.1.3/docs.json + patch -uN --no-backup-if-mismatch --reject-file=/tmp/rej ~/.elm/0.19.1/packages/elm-explorations/webgl/1.1.3/src/Elm/Kernel/WebGL.js ./PatchWebGLForCanvasElement.patch || true \ No newline at end of file diff --git a/elm-patches/PatchWebGLForCanvasElement.patch b/elm-patches/PatchWebGLForCanvasElement.patch new file mode 100644 index 00000000..f34c5efa --- /dev/null +++ b/elm-patches/PatchWebGLForCanvasElement.patch @@ -0,0 +1,18 @@ +--- /home/adroit/.elm/0.19.1/packages/elm-explorations/webgl/1.1.3/src/Elm/Kernel/WebGL.js 2024-06-04 20:49:20.496093720 -0500 ++++ /home/adroit/.elm/0.19.1/packages/elm-explorations/webgl/1.1.3/src/Elm/Kernel/WebGL_patched.js 2024-06-04 20:49:51.076047240 -0500 +@@ -787,6 +787,7 @@ + }, model.__options); + + var canvas = __VirtualDom_doc.createElement('canvas'); ++ canvas.created_by_elm = true; + var gl = canvas.getContext && ( + canvas.getContext('webgl', options.contextAttributes) || + canvas.getContext('experimental-webgl', options.contextAttributes) +@@ -834,6 +835,7 @@ + + } else { + canvas = __VirtualDom_doc.createElement('div'); ++ canvas.created_by_elm = true; + canvas.innerHTML = 'Enable WebGL to see this content!'; + } + diff --git a/elm-patches/dummyproject/elm.json b/elm-patches/dummyproject/elm.json index b1d9be63..ca576557 100644 --- a/elm-patches/dummyproject/elm.json +++ b/elm-patches/dummyproject/elm.json @@ -9,7 +9,8 @@ "elm/browser": "1.0.2", "elm/core": "1.0.5", "elm/html": "1.0.0", - "elm/url": "1.0.0" + "elm/url": "1.0.0", + "elm-explorations/webgl": "1.1.3" }, "indirect": { "elm/json": "1.1.3",