mirror of
https://github.com/BinomialLLC/basis_universal.git
synced 2026-09-30 22:25:24 +00:00
Merge pull request #26 from prestomation/master
Modularize emscripten build.
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
|
||||
<body>
|
||||
<script>
|
||||
Module.onRuntimeInitialized = () => {
|
||||
BASIS().then(Module => {
|
||||
|
||||
const { BasisFile, initializeBasis } = Module;
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
|
||||
}, false );
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
function log(s) {
|
||||
|
||||
|
||||
@@ -258,7 +258,7 @@ function viewAlpha() { drawMode = 2; redraw(); }
|
||||
<div id='logger'></div>
|
||||
</body>
|
||||
<script>
|
||||
Module.onRuntimeInitialized = () => {
|
||||
BASIS({onRuntimeInitialized : () => {
|
||||
var gl = elem('canvas').getContext('webgl');
|
||||
// Load the DXT extension, and verify it exists.
|
||||
if (!gl.getExtension('WEBKIT_WEBGL_compressed_texture_s3tc') && !gl.getExtension('WEBGL_compressed_texture_s3tc')) {
|
||||
@@ -275,6 +275,6 @@ function viewAlpha() { drawMode = 2; redraw(); }
|
||||
}, false);
|
||||
|
||||
runLoadFile();
|
||||
}
|
||||
}}).then(module => window.Module = module);
|
||||
</script>
|
||||
</html>
|
||||
|
||||
@@ -17,5 +17,5 @@ if (EMSCRIPTEN)
|
||||
set_target_properties(basis_transcoder.js PROPERTIES
|
||||
OUTPUT_NAME "basis_transcoder"
|
||||
SUFFIX ".js"
|
||||
LINK_FLAGS "--bind -s ALLOW_MEMORY_GROWTH=1 -O3 -s ASSERTIONS=0 -s MALLOC=emmalloc")
|
||||
LINK_FLAGS "--bind -s ALLOW_MEMORY_GROWTH=1 -O3 -s ASSERTIONS=0 -s MALLOC=emmalloc -s MODULARIZE=1 -s EXPORT_NAME=BASIS ")
|
||||
endif()
|
||||
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
Reference in New Issue
Block a user