0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / samples / webgl / occt-webgl-viewer.js
1 var OccViewerModule =\r
2 {\r
3   print: (function() {\r
4     var anElement = document.getElementById('output');\r
5     return function(theText) { anElement.innerHTML += theText + "<br>"; };\r
6   })(),\r
7   printErr: function(theText) {\r
8     //var anElement = document.getElementById('output');\r
9     //anElement.innerHTML += theText + "<br>";\r
10     console.warn(theText);\r
11   },\r
12   canvas: (function() {\r
13     var aCanvas = document.getElementById('occViewerCanvas');\r
14     var aGlCtx =                   aCanvas.getContext ('webgl2', { alpha: false, depth: true, antialias: false, preserveDrawingBuffer: true } );\r
15     if (aGlCtx == null) { aGlCtx = aCanvas.getContext ('webgl',  { alpha: false, depth: true, antialias: false, preserveDrawingBuffer: true } ); }\r
16     return aCanvas;\r
17   })(),\r
18 \r
19   onRuntimeInitialized: function() {\r
20     //console.log(" @@ onRuntimeInitialized()" + Object.getOwnPropertyNames(OccViewerModule));\r
21   }\r
22 };\r
23 \r
24 const OccViewerModuleInitialized = createOccViewerModule(OccViewerModule);\r
25 OccViewerModuleInitialized.then(function(Module) {\r
26   //OccViewerModule.setCubemapBackground ("cubemap.jpg");\r
27   OccViewerModule.openFromUrl ("ball", "samples/Ball.brep");\r
28 });\r