From c48cb80b17932f4a5dc2d573f25325c3fb6d360c Mon Sep 17 00:00:00 2001 From: Xeltalliv Date: Sat, 2 Nov 2024 01:44:02 +0200 Subject: [PATCH] Provide temporary public API before proper one is made --- extensions/Xeltalliv/simple3D.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/extensions/Xeltalliv/simple3D.js b/extensions/Xeltalliv/simple3D.js index 9663a091e4..5c83057c8e 100644 --- a/extensions/Xeltalliv/simple3D.js +++ b/extensions/Xeltalliv/simple3D.js @@ -4800,5 +4800,33 @@ void main() { } gl.__proto__ = ogl; //*/ + publicApi.i_will_not_ask_for_help_when_these_break = () => { + console.warn("WARNING: You are accessing Simple3D internals. Expect them to change frequently with no regard to backwards compatibility. WHEN your code breaks, do not expect help.\n\nProper stable APIs will be added later."); + return { + canvas, + gl, + definitions, + meshes, + programs, + modelDecoder, + uploadBuffer, + getFshSrc: () => fshSrc, + setFshSrc: (src) => {vshSrc = src}, + getVshSrc: () => fshSrc, + setVshSrc: (src) => {vshSrc = src}, + canvasRenderTarget, + resetEverything, + getTransforms: () => transforms, + setTransforms: (t) => {transforms = t}, + getSelectedTransform: () => selectedTransform, + setSelectedTransform: (t) => {selectedTransform = t}, + getWorkerSrc: () => workerSrc, + setWorkerSrc: (src) => {workerSrc = src}, + extInfo, + Extension, + Blendings, + } + }; + Scratch.extensions.register(new Extension()); })(Scratch);