mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-01 17:36:21 +03:00
DPLUGIN() macros no more defines exported function PLUGINFACTORY when building static libraries. DRAWEXE executable now pre-loads a set of plugins when building static libraries. dversion - added WebAssembly info.
29 lines
1.1 KiB
JavaScript
29 lines
1.1 KiB
JavaScript
var OccViewerModule =
|
|
{
|
|
print: (function() {
|
|
var anElement = document.getElementById('output');
|
|
return function(theText) { anElement.innerHTML += theText + "<br>"; };
|
|
})(),
|
|
printErr: function(theText) {
|
|
//var anElement = document.getElementById('output');
|
|
//anElement.innerHTML += theText + "<br>";
|
|
console.warn(theText);
|
|
},
|
|
canvas: (function() {
|
|
var aCanvas = document.getElementById('occViewerCanvas');
|
|
var aGlCtx = aCanvas.getContext ('webgl2', { alpha: false, depth: true, antialias: false, preserveDrawingBuffer: true } );
|
|
if (aGlCtx == null) { aGlCtx = aCanvas.getContext ('webgl', { alpha: false, depth: true, antialias: false, preserveDrawingBuffer: true } ); }
|
|
return aCanvas;
|
|
})(),
|
|
|
|
onRuntimeInitialized: function() {
|
|
//console.log(" @@ onRuntimeInitialized()" + Object.getOwnPropertyNames(OccViewerModule));
|
|
}
|
|
};
|
|
|
|
const OccViewerModuleInitialized = createOccViewerModule(OccViewerModule);
|
|
OccViewerModuleInitialized.then(function(Module) {
|
|
//OccViewerModule.setCubemapBackground ("cubemap.jpg");
|
|
OccViewerModule.openFromUrl ("ball", "samples/Ball.brep");
|
|
});
|