wasm: add Emscripten module accessor to qtloader.js
After enabling -s MODULARIZE=1 there is no longer a global MODULE object. Add module() accessor which can be used to retrieve the Emscripten module. This does not really fit with the current state tracking since the app transitions from “loading” to “running” before the module object is ready. We’ll have to revisit this at some point. Change-Id: Ib7191cf4ce436e1de99f84b63ed4c10936fa62b1 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
This commit is contained in:
parent
e1fe816d46
commit
c6362cd55c
@ -126,6 +126,11 @@
|
||||
// Signals to the application that a canvas has been resized.
|
||||
// setFontDpi
|
||||
// Sets the logical font dpi for the application.
|
||||
// module
|
||||
// Returns the Emscripten module object, or undefined if the module
|
||||
// has not been created yet. Note that the module object becomes available
|
||||
// at the very end of the loading sequence, _after_ the transition from
|
||||
// Loading to Running occurs.
|
||||
|
||||
|
||||
function QtLoader(config)
|
||||
@ -249,6 +254,7 @@ function QtLoader(config)
|
||||
publicAPI.resizeCanvasElement = resizeCanvasElement;
|
||||
publicAPI.setFontDpi = setFontDpi;
|
||||
publicAPI.fontDpi = fontDpi;
|
||||
publicAPI.module = module;
|
||||
|
||||
self.restartCount = 0;
|
||||
|
||||
@ -586,6 +592,10 @@ function QtLoader(config)
|
||||
return self.qtFontDpi;
|
||||
}
|
||||
|
||||
function module() {
|
||||
return self.module;
|
||||
}
|
||||
|
||||
setStatus("Created");
|
||||
|
||||
return publicAPI;
|
||||
|
Loading…
x
Reference in New Issue
Block a user