C++ͷΫϥεʹJavaScript͔ΒΞΫηε͢Δ #include ! class Hoge {! const int a;! public:! Hoge( int a_ ) : a( a_ ) {}! int run( int b ) { return a * b; }! };! using namespace emscripten;! EMSCRIPTEN_BINDINGS(mod) {! class_("Hoge")! .constructor()! .function("run", &Hoge::run );! } var hoge = new Module.Hoge( 3 );! var result = hoge.run( 4 );! // result = 12
OpenGL͕WebGLʹϚοϓ͞Ε͍ͯΔ OpenGL ESʹ؆୯ʹஔ͖͑ΒΕΔͱ͜Ζ͚ͩ std::cout << glGetString( GL_VERSION ) << std::endl; WebGL 1.0 (OpenGL ES 2.0 Chromium) WARNING: using emscripten GL emulation. This is a collection of limited workarounds, do not expect it to work ܯࠂEmscriptenͷ(-ΤϛϡϨʔγϣϯΛ༻தɻ ͜Ε·ͩ࡞Γ͔͚ͩʂಈ͘ͱࢥ͏ͳΑʂ WARNING: using emscripten GL immediate mode emulation. This is very limited in what it supports ܯࠂEmscriptenͷ(-JNNFEJBUFϞʔυͷ ΤϛϡϨʔγϣϯΛ༻தɻ ͜ͷ෦ͷαϙʔτঢ়گۃΊͯݶఆతͩʂ ωΠςΟϒͰಈ͍ͯΔͷʹϒϥβͰಈ͔ͳ͍ͱ͖ Emscriptenͷ࠷৽൛ΛQVMMͯ͘͠Δͱಈ͘ࣄ͕ Α͋͘Δ