Skip to content

Commit

Permalink
Initial video encoder implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
PolyMeilex committed Feb 3, 2021
1 parent a498b77 commit 8ed4e82
Show file tree
Hide file tree
Showing 18 changed files with 456 additions and 74 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/target
**/*.rs.bk
/settings.ron
/settings.ron
/out
149 changes: 145 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ authors = ["Poly <[email protected]>"]
edition = "2018"

[features]
default = ["compile_shader","synth"]
default = ["compile_shader", "synth"]
compile_shader = []
record=[]
record=["mpeg_encoder"]
play_along=[]
synth=["cpal","fluidlite","fluidlite-lib"]

Expand Down Expand Up @@ -41,6 +41,9 @@ fluidlite-lib = {git= "https://github.com/PolyMeilex/fluidlite-rs.git", optional
ron = "0.6.4"
serde = { version = "1.0.118", features = ["serde_derive"] }

mpeg_encoder = {git="https://github.com/PolyMeilex/mpeg_encoder_next.git", optional=true}
# mpeg_encoder = {path="../mpeg_encoder_next", optional=true}

# js-sys = { git = "https://github.com/rustwasm/wasm-bindgen" }
# web-sys = { git = "https://github.com/rustwasm/wasm-bindgen" }
# wasm-bindgen = { git = "https://github.com/rustwasm/wasm-bindgen" }
Expand Down
9 changes: 9 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
build-app:
cargo build --release
run-app:
cargo run --release

build-recorder:
cargo build --release --no-default-features --features record
run-recorder:
cargo run --release --no-default-features --features record $(file)
21 changes: 12 additions & 9 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,18 @@ impl App {
.get_current_frame()
.expect("Could not get_current_frame()");

self.target
.gpu
.clear(&frame, self.target.state.config.background_color.into());

self.game_scene.render(&mut self.target, &frame);

self.target
.text_renderer
.render(&self.target.window, &mut self.target.gpu, &frame);
self.target.gpu.clear(
&frame.output.view,
self.target.state.config.background_color.into(),
);

self.game_scene.render(&mut self.target, &frame.output.view);

self.target.text_renderer.render(
&self.target.window,
&mut self.target.gpu,
&frame.output.view,
);

self.target.gpu.submit().unwrap();
}
Expand Down
Loading

0 comments on commit 8ed4e82

Please sign in to comment.