Simplify index wrapper, namespacing.
Experiment with function exports. Not quite working.
This commit is contained in:
parent
740211ed4c
commit
b891520ff9
5 changed files with 71 additions and 95 deletions
41
index.html
Normal file
41
index.html
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
<!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>
|
||||
Loading…
Add table
Add a link
Reference in a new issue