Skip to content

Commit

Permalink
Expose missing context methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Frizi committed Jul 10, 2019
1 parent 533cdce commit 11430b0
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions amethyst_rendy/src/bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ impl<B: Backend> PlanContext<B> {
self.passes.get(&target).and_then(|p| p.node())
}

pub fn get_pass_node(&mut self, target: Target) -> Result<NodeId, Error> {
pub fn get_node(&mut self, target: Target) -> Result<NodeId, Error> {
match self.get_pass_node_raw(target) {
Some(node) => Ok(node),
None => {
Expand Down Expand Up @@ -311,7 +311,7 @@ impl<B: Backend> PlanContext<B> {
Ok(self.outputs.get(&image_ref).cloned())
}

pub fn register_output(&mut self, output: TargetImage, image: ImageId) -> Result<(), Error> {
fn register_output(&mut self, output: TargetImage, image: ImageId) -> Result<(), Error> {
if self.outputs.contains_key(&output) {
return Err(format_err!(
"Trying to register already registered output image {:?}",
Expand Down Expand Up @@ -422,6 +422,16 @@ impl<'a, B: Backend> TargetPlanContext<'a, B> {
pub fn graph(&mut self) -> &mut GraphBuilder<B, Resources> {
self.plan_context.graph()
}

/// Retreive render target metadata, e.g. size.
pub fn target_metadata(&self, target: Target) -> Option<TargetMetadata> {
self.plan_context.target_metadata(target)
}

/// Access computed NodeId of render target.
pub fn get_node(&mut self, target: Target) -> Result<NodeId, Error> {
self.plan_context.get_node(target)
}
}

/// An identifier for output image of specific render target.
Expand Down

0 comments on commit 11430b0

Please sign in to comment.