diff --git a/Cargo.lock b/Cargo.lock index cfb41e1..731c10d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -829,6 +829,7 @@ version = "0.1.0" dependencies = [ "anyhow", "bass-sys", + "framework", "ggez", "image", "imgui", diff --git a/Cargo.toml b/Cargo.toml index 2b639ed..92dcc41 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,6 +25,7 @@ structopt = "0.3.21" image = "0.23.12" imgui = "0.6.1" imgui-winit-support = "0.6.1" +framework = { path = "framework" } [dependencies.libosu] git = "https://github.com/iptq/libosu" diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml new file mode 100644 index 0000000..4f71711 --- /dev/null +++ b/android/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/framework/examples/square.rs b/framework/examples/square.rs new file mode 100644 index 0000000..17f02ff --- /dev/null +++ b/framework/examples/square.rs @@ -0,0 +1,4 @@ +use framework::Game; + +fn main() { +} diff --git a/framework/src/game.rs b/framework/src/game.rs index 3d63859..d56fcd5 100644 --- a/framework/src/game.rs +++ b/framework/src/game.rs @@ -1 +1,29 @@ -pub struct Game {} +pub struct ObjectWrapper { + id: usize, + inner: Box, +} + +pub trait Object { + fn update(&mut self); + + fn draw(&self); +} + +pub struct Context { +} + +pub struct Game { + objects: Vec, +} + +impl Game { + pub fn run(mut self, func: F) + where + F: Fn(), + { + loop { + for object in self.objects.iter_mut() { + } + } + } +} diff --git a/framework/src/lib.rs b/framework/src/lib.rs index 0e00e40..70674b3 100644 --- a/framework/src/lib.rs +++ b/framework/src/lib.rs @@ -1,2 +1,4 @@ mod game; mod renderer; + +pub use crate::game::Game; diff --git a/framework/src/renderer.rs b/framework/src/renderer/mod.rs similarity index 100% rename from framework/src/renderer.rs rename to framework/src/renderer/mod.rs diff --git a/framework/src/window.rs b/framework/src/window.rs new file mode 100644 index 0000000..02f79fa --- /dev/null +++ b/framework/src/window.rs @@ -0,0 +1,4 @@ +/// Window, or the viewport of the entire game +pub struct Window { + +}