diff options
author | TrueDoctor <dennis@kobert.dev> | 2019-06-22 00:03:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-22 00:03:37 +0200 |
commit | 8b2040eb93e8e4355c8f357b775dedcffafff3dc (patch) | |
tree | 0b2c4724f0c75d09ee8b86f397bf6602a899e825 /webhogg/wasm/src/context/mod.rs | |
parent | 9e9c1c822a64c0a65033b7eed07ea661a385cecc (diff) | |
parent | 5522731ec4de8741f923b339ca942f8aaff2a338 (diff) |
Merge pull request #39 from TrueDoctor/game_server_refactor
Game server refactor
Diffstat (limited to 'webhogg/wasm/src/context/mod.rs')
-rw-r--r-- | webhogg/wasm/src/context/mod.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/webhogg/wasm/src/context/mod.rs b/webhogg/wasm/src/context/mod.rs new file mode 100644 index 0000000..09902ce --- /dev/null +++ b/webhogg/wasm/src/context/mod.rs @@ -0,0 +1,26 @@ +mod shader; +mod webgl; +pub mod graphics; +pub mod logic; + +use graphics::GraphicsContext; +use logic::LogicContext; + +static mut GTX: Option<GraphicsContext> = None; +static mut LTX: Option<LogicContext> = None; + +pub fn get_graphics() -> &'static mut GraphicsContext { + unsafe { GTX.as_mut().unwrap() } +} + +pub fn get_logic() -> &'static mut LogicContext { + unsafe { LTX.as_mut().unwrap() } +} + +pub fn set_graphics(gtx: GraphicsContext) { + unsafe { GTX = Some(gtx) } +} + +pub fn set_logic(ltx: LogicContext) { + unsafe { LTX = Some(ltx) } +} |