@geastack/geatsc-plugin-gea 0.1.16 → 0.1.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cpp-ir.js CHANGED
@@ -1511,12 +1511,12 @@ export function directCanvasInteropSource(usesCanvas, options = {}) {
1511
1511
  "}",
1512
1512
  "",
1513
1513
  "template <typename Image, typename X, typename Y>",
1514
- "inline void canvasDrawImage(gea::embedded::ui::CanvasRenderingContext2D &ctx, const Image &image, const X &x, const Y &y) {",
1514
+ "inline void canvasDrawImage(gea::embedded::ui::CanvasRenderingContext2D ctx, const Image &image, const X &x, const Y &y) {",
1515
1515
  " ctx.drawImage(canvasImageId(image), canvasInt(x), canvasInt(y));",
1516
1516
  "}",
1517
1517
  "",
1518
1518
  "template <typename Image, typename X, typename Y, typename W, typename H>",
1519
- "inline void canvasDrawImage(gea::embedded::ui::CanvasRenderingContext2D &ctx, const Image &image, const X &x, const Y &y, const W &w, const H &h) {",
1519
+ "inline void canvasDrawImage(gea::embedded::ui::CanvasRenderingContext2D ctx, const Image &image, const X &x, const Y &y, const W &w, const H &h) {",
1520
1520
  " ctx.drawImage(canvasImageId(image), canvasInt(x), canvasInt(y), canvasInt(w), canvasInt(h));",
1521
1521
  "}",
1522
1522
  "",
@@ -2256,12 +2256,12 @@ function canvasInteropSource(usesCanvas, directCanvas) {
2256
2256
  "}",
2257
2257
  "",
2258
2258
  "template <typename Image, typename X, typename Y>",
2259
- "inline void canvasDrawImage(gea::embedded::ui::CanvasRenderingContext2D &ctx, const Image &image, const X &x, const Y &y) {",
2259
+ "inline void canvasDrawImage(gea::embedded::ui::CanvasRenderingContext2D ctx, const Image &image, const X &x, const Y &y) {",
2260
2260
  " ctx.drawImage(canvasImageId(image), canvasInt(x), canvasInt(y));",
2261
2261
  "}",
2262
2262
  "",
2263
2263
  "template <typename Image, typename X, typename Y, typename W, typename H>",
2264
- "inline void canvasDrawImage(gea::embedded::ui::CanvasRenderingContext2D &ctx, const Image &image, const X &x, const Y &y, const W &w, const H &h) {",
2264
+ "inline void canvasDrawImage(gea::embedded::ui::CanvasRenderingContext2D ctx, const Image &image, const X &x, const Y &y, const W &w, const H &h) {",
2265
2265
  " ctx.drawImage(canvasImageId(image), canvasInt(x), canvasInt(y), canvasInt(w), canvasInt(h));",
2266
2266
  "}",
2267
2267
  "",
@@ -87,6 +87,13 @@ const geaDeviceInfoHostMethods = ['deviceId', 'platform', 'chipModel', 'chipArch
87
87
  const geaGea3dHostMethods = [
88
88
  'createBuffer', 'bufferDataF32', 'bufferDataU32', 'beginFrame',
89
89
  'ambientLight', 'directionalLight', 'drawElements', 'endFrame', 'stat',
90
+ // scene graph
91
+ 'deleteBuffer', 'createGeometry', 'deleteGeometry', 'geometryBuffers',
92
+ 'createMaterial', 'deleteMaterial', 'materialSet', 'createNode',
93
+ 'deleteNode', 'nodeParent', 'nodeTransform', 'nodeMatrix', 'nodeFlags',
94
+ 'nodeGeometry', 'nodeInstances', 'nodeLight', 'nodeLightTarget',
95
+ 'cameraProjection', 'sceneEnvironment', 'renderOptions', 'renderTarget',
96
+ 'createSurface', 'drawScene', 'raycast', 'rayResult',
90
97
  ];
91
98
  const geaGea3dDeclarations = [...geaHostDeclarations, '#include "gea3d_native.h"'];
92
99
  const geaMemoryHostMethods = [
@@ -663,6 +663,33 @@ export function createGeaHostShims() {
663
663
  drawElements: "gea::host::gea3d::drawElements",
664
664
  endFrame: "gea::host::gea3d::endFrame",
665
665
  stat: "gea::host::gea3d::stat",
666
+ // The scene-graph engine (gea3d's three.js-style API): geometry,
667
+ // materials and nodes live natively and one drawScene renders a frame.
668
+ deleteBuffer: "gea::host::gea3d::deleteBuffer",
669
+ createGeometry: "gea::host::gea3d::createGeometry",
670
+ deleteGeometry: "gea::host::gea3d::deleteGeometry",
671
+ geometryBuffers: "gea::host::gea3d::geometryBuffers",
672
+ createMaterial: "gea::host::gea3d::createMaterial",
673
+ deleteMaterial: "gea::host::gea3d::deleteMaterial",
674
+ materialSet: "gea::host::gea3d::materialSet",
675
+ createNode: "gea::host::gea3d::createNode",
676
+ deleteNode: "gea::host::gea3d::deleteNode",
677
+ nodeParent: "gea::host::gea3d::nodeParent",
678
+ nodeTransform: "gea::host::gea3d::nodeTransform",
679
+ nodeMatrix: "gea::host::gea3d::nodeMatrix",
680
+ nodeFlags: "gea::host::gea3d::nodeFlags",
681
+ nodeGeometry: "gea::host::gea3d::nodeGeometry",
682
+ nodeInstances: "gea::host::gea3d::nodeInstances",
683
+ nodeLight: "gea::host::gea3d::nodeLight",
684
+ nodeLightTarget: "gea::host::gea3d::nodeLightTarget",
685
+ cameraProjection: "gea::host::gea3d::cameraProjection",
686
+ sceneEnvironment: "gea::host::gea3d::sceneEnvironment",
687
+ renderOptions: "gea::host::gea3d::renderOptions",
688
+ renderTarget: "gea::host::gea3d::renderTarget",
689
+ createSurface: "gea::host::gea3d::createSurface",
690
+ drawScene: "gea::host::gea3d::drawScene",
691
+ raycast: "gea::host::gea3d::raycast",
692
+ rayResult: "gea::host::gea3d::rayResult",
666
693
  },
667
694
  "navigator.geolocation": {
668
695
  hasFix: "gea::host::navigator.geolocation.hasFix",
@@ -3045,7 +3072,7 @@ export function createGeaHostShims() {
3045
3072
  returnType: "void",
3046
3073
  },
3047
3074
  ],
3048
- // `GeaEmbeddedImage`'s own four methods. The struct
3075
+ // `GeaEmbeddedImage`'s own methods. The struct
3049
3076
  // (`core/packages/host/include/host/image.h:19-29`) is held by value --
3050
3077
  // `IMAGE_RECEIVER_TYPES` is what the property getters below already read
3051
3078
  // it through -- so each is a direct call on the receiver, exactly like
@@ -3059,6 +3086,13 @@ export function createGeaHostShims() {
3059
3086
  // table"), which is correct of the compiler and a gap in this table: the
3060
3087
  // member exists in the header and in `index.d.ts`, and only the spelling
3061
3088
  // that joins them was missing.
3089
+ decode: [
3090
+ {
3091
+ receiverTypes: IMAGE_RECEIVER_TYPES,
3092
+ emit: "({receiver}).decode()",
3093
+ returnType: "bool",
3094
+ },
3095
+ ],
3062
3096
  dispose: [
3063
3097
  {
3064
3098
  receiverTypes: IMAGE_RECEIVER_TYPES,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geastack/geatsc-plugin-gea",
3
- "version": "0.1.16",
3
+ "version": "0.1.18",
4
4
  "description": "Gea IR backend plugin for geatsc.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -56,6 +56,6 @@
56
56
  "@types/node": "^22.15.3"
57
57
  },
58
58
  "peerDependencies": {
59
- "@geastack/compiler": ">=1.0.20"
59
+ "@geastack/compiler": ">=1.0.22"
60
60
  }
61
61
  }