start work on framework

This commit is contained in:
Michael Zhang 2021-01-15 10:46:55 -06:00
parent d04074dc42
commit 59a76e2db7
Signed by: michael
GPG key ID: BDA47A31A3C8EE6B
8 changed files with 48 additions and 1 deletions

1
Cargo.lock generated
View file

@ -829,6 +829,7 @@ version = "0.1.0"
dependencies = [
"anyhow",
"bass-sys",
"framework",
"ggez",
"image",
"imgui",

View file

@ -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"

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="osu.editor"
android:versionCode="1"
android:versionName="1.0" >
</manifest>

View file

@ -0,0 +1,4 @@
use framework::Game;
fn main() {
}

View file

@ -1 +1,29 @@
pub struct Game {}
pub struct ObjectWrapper {
id: usize,
inner: Box<dyn Object>,
}
pub trait Object {
fn update(&mut self);
fn draw(&self);
}
pub struct Context {
}
pub struct Game {
objects: Vec<ObjectWrapper>,
}
impl Game {
pub fn run<F>(mut self, func: F)
where
F: Fn(),
{
loop {
for object in self.objects.iter_mut() {
}
}
}
}

View file

@ -1,2 +1,4 @@
mod game;
mod renderer;
pub use crate::game::Game;

4
framework/src/window.rs Normal file
View file

@ -0,0 +1,4 @@
/// Window, or the viewport of the entire game
pub struct Window {
}