aboutsummaryrefslogtreecommitdiff
path: root/demos/scons-embind/foo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'demos/scons-embind/foo.cpp')
-rw-r--r--demos/scons-embind/foo.cpp11
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);
+}
+