Mercurial > hg > orthanc-stone
diff Platforms/Wasm/wasm-application-runner.ts @ 562:37e396ae08a3
Merged dev into default
author | Alain Mazy <am@osimis.io> |
---|---|
date | Thu, 18 Apr 2019 07:30:56 +0000 |
parents | e1ba16436d59 |
children | 70992b38aa8a 636eb0e4c9dd |
line wrap: on
line diff
--- a/Platforms/Wasm/wasm-application-runner.ts Wed Apr 17 17:57:50 2019 +0200 +++ b/Platforms/Wasm/wasm-application-runner.ts Thu Apr 18 07:30:56 2019 +0000 @@ -1,5 +1,6 @@ import Stone = require('./stone-framework-loader'); import StoneViewport = require('./wasm-viewport'); +import * as Logger from './logger' if (!('WebAssembly' in window)) { alert('Sorry, your browser does not support WebAssembly :('); @@ -19,7 +20,7 @@ export var CreateCppViewport: Function = null; var ReleaseCppViewport: Function = null; var StartWasmApplication: Function = null; -export var SendMessageToStoneApplication: Function = null; +export var SendSerializedMessageToStoneApplication: Function = null; function DoAnimationThread() { if (WasmDoAnimation != null) { @@ -84,7 +85,7 @@ // the WebAssembly environment) and then, create and initialize the Wasm application Stone.Framework.Initialize(true, function () { - console.log("Connecting C++ methods to JS methods"); + Logger.defaultLogger.debug("Connecting C++ methods to JS methods"); SetStartupParameter = (<any> window).StoneFrameworkModule.cwrap('SetStartupParameter', null, ['string', 'string']); CreateWasmApplication = (<any> window).StoneFrameworkModule.cwrap('CreateWasmApplication', null, ['number']); @@ -99,14 +100,14 @@ // no need to put this into the globals for it's only used in this very module WasmDoAnimation = (<any> window).StoneFrameworkModule.cwrap('WasmDoAnimation', null, []); - SendMessageToStoneApplication = (<any> window).StoneFrameworkModule.cwrap('SendMessageToStoneApplication', 'string', ['string']); + SendSerializedMessageToStoneApplication = (<any> window).StoneFrameworkModule.cwrap('SendSerializedMessageToStoneApplication', 'string', ['string']); - console.log("Connecting C++ methods to JS methods - done"); + Logger.defaultLogger.debug("Connecting C++ methods to JS methods - done"); // Prevent scrolling document.body.addEventListener('touchmove', function (event) { event.preventDefault(); - }, false); + }, { passive: false}); // must not be passive if calling event.preventDefault, ie to cancel scroll or zoom of the whole interface _InitializeWasmApplication(orthancBaseUrl); });