nim-wasm-test/index.html
Mahlon E. Smith b891520ff9
Simplify index wrapper, namespacing.
Experiment with function exports.  Not quite working.
2025-08-19 23:16:53 -07:00

41 lines
1.1 KiB
HTML

<!doctype html>
<html lang="EN-us">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>raylib web game</title>
<meta name="title" content="raylib web game">
<meta name="description" content="New raylib web videogame, developed using raylib videogames library">
<meta name="keywords" content="raylib, programming, examples, html5, C, C++, library, learn, games, videogames">
<meta name="viewport" content="width=device-width">
<style>
body { margin: 0px; overflow: hidden; background-color: white; }
canvas.emscripten { border: 0px none; background-color: white; }
</style>
</head>
<body>
<canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()" tabindex="-1"></canvas>
<script type="module">
import NimTest from './nimtest.js'
NimTest({
print: (function( text ) {
if ( text === undefined ) return
console.log( text )
})(),
canvas: (function() {
return document.getElementById('canvas');
})()
}).then((nimtest) => {
console.log( "Loaded WASM!" )
// nimtest._nativeGreet()
})
</script>
</body>
</html>