start work on framework
This commit is contained in:
parent
d04074dc42
commit
59a76e2db7
8 changed files with 48 additions and 1 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -829,6 +829,7 @@ version = "0.1.0"
|
|||
dependencies = [
|
||||
"anyhow",
|
||||
"bass-sys",
|
||||
"framework",
|
||||
"ggez",
|
||||
"image",
|
||||
"imgui",
|
||||
|
|
|
@ -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"
|
||||
|
|
7
android/AndroidManifest.xml
Normal file
7
android/AndroidManifest.xml
Normal 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>
|
||||
|
4
framework/examples/square.rs
Normal file
4
framework/examples/square.rs
Normal file
|
@ -0,0 +1,4 @@
|
|||
use framework::Game;
|
||||
|
||||
fn main() {
|
||||
}
|
|
@ -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() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,2 +1,4 @@
|
|||
mod game;
|
||||
mod renderer;
|
||||
|
||||
pub use crate::game::Game;
|
||||
|
|
4
framework/src/window.rs
Normal file
4
framework/src/window.rs
Normal file
|
@ -0,0 +1,4 @@
|
|||
/// Window, or the viewport of the entire game
|
||||
pub struct Window {
|
||||
|
||||
}
|
Loading…
Reference in a new issue