enum_<Format>("Format").value(“A", A).value(“B", B);emscripten::class_<foo>(“foo").constructor<>().property(“format", &foo::format)...;
var foo = new foo();…foo.format = Format.A;
foo.format = Format.A.value;
char swizzle[4];
.property(“swizzle", &Params::swizzle)
/emsdk/upstream/emscripten/cache/sysroot/include/emscripten/wire.h:349:16: error: array 'new' cannot have initialization arguments349 | return new T(v);
<Screenshot 2024-05-25 at 19.37.37.png>
How can I compare two of these for equality?
On May 27, 2024, at 16:40, キャロウ マーク <git...@callow.im> wrote:Is it possible to make aliases of items in the interface being bound with embind? Obviously I could just repeat a definition with the alternate name but that is error prone and I worry it would unnecessarily bloat the code.I want to rename some items in my interface with breaking existing users.
On Jun 1, 2024, at 17:40, キャロウ マーク <git...@callow.im> wrote:!function() {I’ve tried creating a .js file with the following and using it with --pre-js and —post-jsModule['ktxTexture'] = texture;andModule['ktxTexture'] = Module.texture;and
Module['ktxTexture'] = Module.texture;}();“ktxTexture" is the old name, “texture” is the current name of the class.In all cases ktxTexture is added to the module but it is always undefined. texture & Module.texture do not appear to (yet) be defined when the above code is executed, even with the IIFE.Whatever adds the aliases needs to do so without relying on the name of the module instance as that it something user specific.
When run normally the console output tells me Module.texture is “undefined”. However after I had been stepping through the startup code the above worked. This made me realize that post-js is being run before Module is fully initialized. For some reason I thought it was run when everything was ready. I changed toconsole.log(Module.texture)Module['ktxTexture'] = Module.texture;
Module.onRuntimeInitialized = function() {Module['ktxTexture'] = Module.texture;}
--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/71483935-8D80-4C5C-AB3B-E0788578AC49%40callow.im.
On Jun 3, 2024, at 10:11, 'Sam Clegg' via emscripten-discuss <emscripte...@googlegroups.com> wrote:Better to set your `onRuntimeInitialized` in pre-js since that works even for projects that use `-sWASM_ASYNC_COMPILATION=0`