diff Platforms/WebAssembly/wasm-application.ts @ 231:5027cb2feb51 am

viewport is now part of the Application itself and not global anymore
author am@osimis.io
date Thu, 14 Jun 2018 18:49:19 +0200
parents 7d2631320615
children 68856534f005
line wrap: on
line diff
--- a/Platforms/WebAssembly/wasm-application.ts	Thu Jun 14 17:14:10 2018 +0200
+++ b/Platforms/WebAssembly/wasm-application.ts	Thu Jun 14 18:49:19 2018 +0200
@@ -7,8 +7,6 @@
 
 declare var StoneFrameworkModule : Stone.Framework;
 
-var viewport = null;
-
 // global functions
 var WasmWebService_NotifyError: Function = null;
 var WasmWebService_NotifySuccess: Function = null;
@@ -77,16 +75,6 @@
 
 function InitializeWasmApplication(canvasId: string): void {
 
-    console.log("Creating main viewport");
-
-    viewport = new Stone.WasmViewport(StoneFrameworkModule, canvasId);
-    viewport.Initialize(CreateCppViewport());
-
-    document.getElementById(canvasId).onclick = function () {
-        viewport.Redraw();
-    };
-
-
     /************************************** */
     CreateWasmApplication();
 
@@ -99,7 +87,7 @@
         }
     }
 
-    StartWasmApplication(viewport.GetCppViewport());
+    StartWasmApplication();
     /************************************** */
 
     UpdateContentThread();
@@ -112,9 +100,9 @@
     console.log("Connecting C++ methods to JS methods");
     
     SetStartupParameter = StoneFrameworkModule.cwrap('SetStartupParameter', null, ['string', 'string']);
-    CreateWasmApplication = StoneFrameworkModule.cwrap('CreateWasmApplication', null, ['any']);
-    CreateCppViewport = StoneFrameworkModule.cwrap('CreateCppViewport', 'any', []);
-    ReleaseCppViewport = StoneFrameworkModule.cwrap('ReleaseCppViewport', null, ['any']);
+    CreateWasmApplication = StoneFrameworkModule.cwrap('CreateWasmApplication', null, ['number']);
+    CreateCppViewport = StoneFrameworkModule.cwrap('CreateCppViewport', 'number', []);
+    ReleaseCppViewport = StoneFrameworkModule.cwrap('ReleaseCppViewport', null, ['number']);
     StartWasmApplication = StoneFrameworkModule.cwrap('StartWasmApplication', null, []);
 
     WasmWebService_NotifySuccess = StoneFrameworkModule.cwrap('WasmWebService_NotifySuccess', null, ['number', 'string', 'array', 'number', 'number']);