> On Dec 30, 2019, at 17:35, キャロウ マーク <[email protected]> wrote:
> 
> However this makes it very awkward to export values represented in an enum in 
> the C++ API to Javascript. It has to be mentioned 3 times
> 
> class texture {
>     static const uint32_t KTX_FOO;
> };
> 
> const uint32_t KTX_FOO = static_cast<uint32_t>(c++_texture::enum_val);
> 
> and then in the bindings
> 
> .class_property(“KTX_FOO”, &wrapper::texture::KTX_FOO)
> 
> Is there anyway to automate this binding? IT is very tedious and error prone 
> especially if ifdefs are involved.

I solved this with some pre-processor hackery. I don’t like it because the 
constant names are hidden in another file. Is there a better way?

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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/ADEDB34A-4FD1-4361-BF4C-D17D7BF016DD%40callow.im.

Attachment: signature.asc
Description: Message signed with OpenPGP

Reply via email to