sketch_2d/node.rs
1/*
2 * Created on Mon Jul 03 2023
3 *
4 * Copyright (c) storycraft. Licensed under the MIT Licence.
5 */
6
7use wgpu::RenderPass;
8
9use crate::context::{DrawContext, RenderContext};
10
11pub trait DrawNode: Send {
12 fn prepare(&self, ctx: &mut DrawContext, depth: f32);
13}
14
15pub trait RenderNode {
16 fn render_opaque<'rpass>(
17 &'rpass self,
18 ctx: &RenderContext<'rpass>,
19 pass: &mut RenderPass<'rpass>,
20 );
21
22 fn render_transparent<'rpass>(
23 &'rpass self,
24 ctx: &RenderContext<'rpass>,
25 pass: &mut RenderPass<'rpass>,
26 );
27}