diff options
author | Chad Austin <chad@imvu.com> | 2013-05-17 12:52:32 -0700 |
---|---|---|
committer | Chad Austin <chad@imvu.com> | 2013-05-17 13:04:09 -0700 |
commit | 184ff9ea2d18c09988226afb90328679e9818d0d (patch) | |
tree | 876b10b0db3ea1d44c45152c735fe6d488110411 /demos/scons-embind/foo.cpp | |
parent | ec19fe482bf564de68a076ed093af131d502bb30 (diff) |
Add a demo that showcases using scons to build an embind library you can load from JavaScript.
Diffstat (limited to 'demos/scons-embind/foo.cpp')
-rw-r--r-- | demos/scons-embind/foo.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/demos/scons-embind/foo.cpp b/demos/scons-embind/foo.cpp new file mode 100644 index 00000000..61be501a --- /dev/null +++ b/demos/scons-embind/foo.cpp @@ -0,0 +1,11 @@ +#include <stdio.h> +#include <emscripten/bind.h> + +void print_some_stuff(int a, float b, const std::string& s) { + printf("print_some_stuff: %d, %f, %s\n", a, b, s.c_str()); +} + +EMSCRIPTEN_BINDINGS(foo) { + emscripten::function("print_some_stuff", &print_some_stuff); +} + |