Added some more WebGL functions to gl_functions.js. Made the test_app render something more interesting. Added a bool return from App_UpdateAndRender which allows it to request that the application loop ends.
This commit is contained in:
@@ -59,8 +59,9 @@ async function MainLoop()
|
||||
console.log("Running!");
|
||||
function renderFrame(currentTime)
|
||||
{
|
||||
appGlobals.wasmModule.exports.App_UpdateAndRender(currentTime);
|
||||
window.requestAnimationFrame(renderFrame);
|
||||
let shouldContinue = appGlobals.wasmModule.exports.App_UpdateAndRender(currentTime);
|
||||
if (shouldContinue) { window.requestAnimationFrame(renderFrame); }
|
||||
else { appGlobals.wasmModule.exports.App_Close(); }
|
||||
}
|
||||
window.requestAnimationFrame(renderFrame);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user