changed projects structure
This commit is contained in:
+3
-4
@@ -28,10 +28,9 @@ step :: proc(delta_time: f64) -> bool {
|
||||
is_init = true
|
||||
}
|
||||
|
||||
if !update_hook() {
|
||||
keep_running := update_hook()
|
||||
if !keep_running {
|
||||
exit_hook()
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
return keep_running
|
||||
}
|
||||
+15
-2
@@ -5,10 +5,23 @@
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Example 1</title>
|
||||
<title>frigg</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<script type="text/javascript" src="index.js"></script>
|
||||
<script type="text/javascript" src="consoleApi.js"></script>
|
||||
<script type="text/javascript" src="odin.js"></script>
|
||||
<script type="text/javascript">
|
||||
"use strict";
|
||||
(async () => {
|
||||
let mem = new odin.WasmMemoryInterface()
|
||||
|
||||
let apis = {
|
||||
'console_api' : new ConsoleApi(mem),
|
||||
};
|
||||
|
||||
await odin.runWasm("./game.wasm", null, apis, mem);
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,20 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
(async () => {
|
||||
await import("./odin.js"); // from the 'sys/wasm/js'
|
||||
|
||||
let mem = new odin.WasmMemoryInterface()
|
||||
|
||||
let js_log = {
|
||||
trace: (str_ptr, str_len) => console.trace(mem.loadString(str_ptr, str_len)),
|
||||
debug: (str_ptr, str_len) => console.debug(mem.loadString(str_ptr, str_len)),
|
||||
info : (str_ptr, str_len) => console.info(mem.loadString(str_ptr, str_len)),
|
||||
warn : (str_ptr, str_len) => console.warn(mem.loadString(str_ptr, str_len)),
|
||||
error: (str_ptr, str_len) => console.error(mem.loadString(str_ptr, str_len)),
|
||||
};
|
||||
|
||||
let extra = {
|
||||
'js_log' : js_log
|
||||
};
|
||||
await odin.runWasm("./game.wasm", null, extra, mem);
|
||||
})();
|
||||
Reference in New Issue
Block a user