Skip to content

Commit

Permalink
Updated code to include note labels in waterfall.
Browse files Browse the repository at this point in the history
  • Loading branch information
guylamar2006 authored Dec 2, 2024
1 parent 7c1ae2e commit 07f189b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions neothesia-core/src/render/waterfall/pipeline/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ pub struct WaterfallPipeline {

instances: Instances<NoteInstance>,
time_uniform: Uniform<TimeUniform>,

text_renderer: TextRenderer,
}

impl<'a> WaterfallPipeline {
Expand Down Expand Up @@ -66,6 +68,8 @@ impl<'a> WaterfallPipeline {

let instances = Instances::new(&gpu.device, notes_count);

let text_renderer = TextRenderer::new(&gpu.device, &gpu.queue);

Self {
render_pipeline,
quad,
Expand All @@ -91,6 +95,9 @@ impl<'a> WaterfallPipeline {
render_pass.draw_indexed(0..self.quad.indices_len, 0, 0..self.instances.len());
}

pub fn add_label(&mut self, text: &str, position: [f32; 2]) {
self.text_renderer.add_text(text, position);

pub fn clear(&mut self) {
self.instances.data.clear();
}
Expand Down

0 comments on commit 07f189b

Please sign in to comment.