[oden] Garbage assets, need to rewrite to IO

This commit is contained in:
John Doty 2023-06-27 17:16:37 -07:00
parent 75fcc427ac
commit 17805fa4a6
17 changed files with 240 additions and 94 deletions

View file

@ -12,6 +12,8 @@ use graphics::GraphicsCommand;
mod typescript;
use typescript::transpile_to_javascript;
pub mod assets;
struct Loader {}
impl Loader {
@ -42,6 +44,7 @@ pub struct ScriptContext {
draw: Value,
gfx: graphics::GraphicsAPI,
_assets: assets::AssetsAPI,
gfx_receive: Receiver<graphics::GraphicsCommand>,
}
@ -56,8 +59,10 @@ impl ScriptContext {
let (gfx_send, gfx_receive) = channel();
let gfx = graphics::GraphicsAPI::define(&context, gfx_send)
let gfx = graphics::GraphicsAPI::define(&context, gfx_send.clone())
.expect("Graphics module should load without error");
let assets = assets::AssetsAPI::define(&context, gfx_send.clone())
.expect("Assets module should load without error");
let module = context
.import_module("./src/main.ts", "")
@ -82,6 +87,8 @@ impl ScriptContext {
gfx,
gfx_receive,
_assets: assets,
}
}