Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

fix(bindings): the test adapter lives where the surface generator cannot see it

esengine59c01ab52f3d
diff --git a/src/esengine/bindings/RendererBindings.cpp b/src/esengine/bindings/RendererBindings.cpp
index edee200ca..a7207ac64 100644
--- a/src/esengine/bindings/RendererBindings.cpp
+++ b/src/esengine/bindings/RendererBindings.cpp
@@ -2,6 +2,7 @@
// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
#include "RendererBindings.hpp"
+#include "TestProbeBindings.hpp"
#include <limits>
#include "../resource/ShaderParser.hpp"
diff --git a/src/esengine/bindings/RendererBindings.hpp b/src/esengine/bindings/RendererBindings.hpp
index 5c89be248..0e4f68e96 100644
--- a/src/esengine/bindings/RendererBindings.hpp
+++ b/src/esengine/bindings/RendererBindings.hpp
@@ -137,21 +137,6 @@ void engine_setCpuProfiling(bool on);
void engine_setRandomSeed(u32 seed);
std::string engine_getCpuScopes();
-#ifdef ES_ENABLE_TEST_PROBES
-/**
- * @brief Ready the shader programs a set of entities will need, drawing none.
- *
- * @details A disposable adapter over `RenderFrame::prewarmPrograms` — the only
- * gated part of shader readiness, the mechanism being ordinary renderer
- * code a production lifecycle would call directly. Writes five counts
- * to @p outPtr; JSON here would put an allocation inside the measurement.
- */
-void engine_prewarmMeshVariants(ecs::Registry& registry, u32 entitiesPtr, u32 count, u32 outPtr);
-
-/** @brief The same, from a prepared cell's own description — five words per
- * renderable at @p rowsPtr, and no entity of it need exist. */
-void engine_prewarmMeshVariantsFromDocument(u32 rowsPtr, u32 count, u32 outPtr);
-#endif
std::string engine_getCounters();
std::string engine_getGpuScopes();
f64 renderer_getTextureBytes();
diff --git a/src/esengine/bindings/TestProbeBindings.hpp b/src/esengine/bindings/TestProbeBindings.hpp
new file mode 100644
index 000000000..1fc99332e
--- /dev/null
+++ b/src/esengine/bindings/TestProbeBindings.hpp
@@ -0,0 +1,39 @@
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
+#pragma once
+/**
+ * @file TestProbeBindings.hpp
+ * @brief Adapters that exist only to let a driver run an experiment.
+ *
+ * @details Deliberately NOT in `ENGINE_BINDING_HEADERS`. The header tool that
+ * generates the native entry-point surface does not read `#ifdef`, so a
+ * test adapter declared beside the shipping ones reaches
+ * `nativeEngineApi.generated.ts` however carefully the web registration
+ * is gated — the gate would gate one ABI and not the other. Living in a
+ * file the generator never opens is what makes that impossible rather
+ * than merely unintended.
+ */
+#include "../core/Types.hpp"
+
+#ifdef ES_ENABLE_TEST_PROBES
+
+namespace esengine {
+namespace ecs { class Registry; }
+
+/**
+ * @brief Ready the shader programs a set of entities will need, drawing none.
+ *
+ * @details A disposable adapter over `RenderFrame::prewarmPrograms` — the only
+ * gated part of shader readiness, the mechanism being ordinary renderer
+ * code a production lifecycle would call directly. Writes seven counts
+ * to @p outPtr; JSON here would put an allocation inside the measurement.
+ */
+void engine_prewarmMeshVariants(ecs::Registry& registry, u32 entitiesPtr, u32 count, u32 outPtr);
+
+/** @brief The same, from a prepared cell's own description — five words per
+ * renderable at @p rowsPtr, and no entity of it need exist. */
+void engine_prewarmMeshVariantsFromDocument(u32 rowsPtr, u32 count, u32 outPtr);
+
+} // namespace esengine
+
+#endif
diff --git a/src/esengine/bindings/WebSDKEntry.cpp b/src/esengine/bindings/WebSDKEntry.cpp
index f0a11056c..6560ca00c 100644
--- a/src/esengine/bindings/WebSDKEntry.cpp
+++ b/src/esengine/bindings/WebSDKEntry.cpp
@@ -20,6 +20,7 @@
#include "ActiveContext.hpp"
#include "ResourceManagerBindings.hpp"
#include "RendererBindings.hpp"
+#include "TestProbeBindings.hpp"
#include "UIBindings.hpp"
#include "BoundarySpan.hpp"
#include "ImmediateDrawBindings.hpp"