diff Resources/CodeGeneration/testWasmIntegrated/main.cpp @ 498:6d62fc8a6988 bgo-commands-codegen

Web demonstrator for codegen ongoing work
author bgo-osimis
date Sun, 24 Feb 2019 13:23:14 +0100
parents 8b6ceae45ba0
children baa9e1e932db
line wrap: on
line diff
--- a/Resources/CodeGeneration/testWasmIntegrated/main.cpp	Sun Feb 24 10:11:38 2019 +0100
+++ b/Resources/CodeGeneration/testWasmIntegrated/main.cpp	Sun Feb 24 13:23:14 2019 +0100
@@ -3,12 +3,15 @@
 
 int main()
 {
-    std::cout << "Hello world from testWasmIntegrated!" << std::endl;
+    std::cout << "Hello world from testWasmIntegrated! (this is sent from C++)" << std::endl;
 }
 
+extern "C" void SendMessageFromCppJS(std::string message);
+extern "C" void SendFreeTextFromCppJS(std::string message);
+
 void EMSCRIPTEN_KEEPALIVE StartWasmApplication(const char* baseUri)
 {
-    printf("StartWasmApplication\n");
+    printf("Hello! (this is sent from C++)\n");
 
 //     // recreate a command line from uri arguments and parse it
 //     boost::program_options::variables_map parameters;
@@ -26,5 +29,5 @@
 
 // //    viewport->SetSize(width_, height_);
 //     printf("StartWasmApplication - completed\n");
-  }
-  
+    SendFreeTextFromCppJS("Hello world from C++!");
+}