--
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/EDD7D00E-4DC6-4025-8D55-11A914BE7F68%40callow.im.
On Apr 23, 2020, at 11:09, Alon Zakai <alon...@gmail.com> wrote:
It might be good to look at how it's used in the test suite,
Looks like it just does python and then the path to the binder. I agree that emsdk integration could be better, seems like right now you need to give it the full path into the subdirectory of the emsdk where it exists.
I also agree those temp files shouldn't be emitted. I'm not sure offhand why that happens, it could be due to the IDL parser library we use, which we didn't write ourselves. Worth filing an issue, hopefully someone can look into that.
...
The binder is emitting the following code into the .cpp file:void array_bounds_check(const int array_size, const int array_idx) {if (array_idx < 0 || array_idx >= array_size) {EM_ASM({throw 'Array index ' + $0 + ' out of bounds: [0,' + $1 + ')';}, array_idx, array_size);}}emcc barfs on " '$' in identifier [-Wdollar-in-identifier-extension]”. WebIDL-Binder.html says nothing about either EM_ASM or ‘array_bounds_check’. And I don’t see any flag to emcc relevant to enabling ASM_JS. How do I fix this?
I could turn off warnings as errors so I’d just get noise but I do not want to do that. At the moment this is blocking me from further progress.Regards-Mark
--
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/5AE37AE3-6D21-4241-9E2F-8C573995E945%40callow.im.
On Apr 25, 2020, at 13:18, キャロウ マーク <git...@callow.im> wrote:I am trying to figure out how to do the equivalent with webidl_binder. I created a
struct UploadResult {
val texture;
GLenum target;
GLenum error;
};
in my c++ class and a matching interface in the idl and this is what the method is declared to return. My current attempt is
UploadResult ur;
val texture = val::module_property("GL")["textures"][texname];
ur.texture = std::move(texture);
ur.target = target;
ur.error = error;
return std::move(ur);
I am getting errors about “implicitly-deleted default constructor” for both ur and val. The use of `val` here raises another question. How do I look something up in module_property?
On Apr 25, 2020, at 13:18, キャロウ マーク <git...@callow.im> wrote:
I need an ArrayBuffer, actually a Uint8Array, passed from JS to my C++ class. With embind my c++ class has
texture(const emscripten::val& data) {
std::vector<uint8_t> bytes{};
bytes.resize(data["byteLength"].as<size_t>());
emscripten::val memory = emscripten::val::module_property("HEAP8")["buffer"];
emscripten::val memoryView = data["constructor"].new_(memory, reinterpret_cast<uintptr_t>(bytes.data()), data["length"].as<uint32_t>());
memoryView.call<void>("set", data);
….
}
How to I do the same using webidl_binder?