4 <meta charset=utf-8><meta content="text/html; charset=utf-8" http-equiv=Content-Type>
5 <link rel="shortcut icon" href="lamp.ico" type="image/x-icon" />
6 <title>OCCT Draw Harness</title>
10 <h2>OCCT Draw Harness</h2>
12 <canvas id=occViewerCanvas oncontextmenu=event.preventDefault() tabindex=-1 style="border:0 none;background-color:#000" width="409" height="409"></canvas>
14 <h4>Output (open JavaScript console):</h4>
16 <script type="text/javascript" src="DRAWEXE.js" charset="utf-8"></script>
18 //! Check browser support.
19 function isWasmSupported()
22 if (typeof WebAssembly === "object"
23 && typeof WebAssembly.instantiate === "function") {
24 const aDummyModule = new WebAssembly.Module (Uint8Array.of (0x0, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00));
25 if (aDummyModule instanceof WebAssembly.Module)
27 return new WebAssembly.Instance(aDummyModule) instanceof WebAssembly.Instance;
33 if (!isWasmSupported())
35 var anElement = document.getElementById('output');
36 anElement.innerHTML += "Browser is too old - WebAssembly support is missing!<br>Please check updates or install a modern browser.<br>";
42 var anElement = document.getElementById('output');
43 //return function(theText) { anElement.innerHTML += theText + "<br>"; };
44 return function(theText) { console.warn(theText); };
46 printErr: function(theText) {
47 //var anElement = document.getElementById('output');
48 //anElement.innerHTML += theText + "<br>";
49 console.warn(theText);
52 var aCanvas = document.getElementById('occViewerCanvas');
56 onRuntimeInitialized: function() {
61 const DRAWEXEInitialized = createDRAWEXE(DRAWEXE);
62 DRAWEXEInitialized.then(function(Module) {
63 //DRAWEXE.eval("dversion");