28 lines
623 B
Rust
28 lines
623 B
Rust
use crate::app::Ctx;
|
|
use crate::elements::*;
|
|
macro_rules! elementvec {
|
|
($({$element: ident, $element_ty: ty})+) => {
|
|
pub struct ElementVec {
|
|
$($element: $element_ty,)+
|
|
}
|
|
impl ElementVec {
|
|
pub fn init(ctx: &Ctx) -> Self {
|
|
// Compile the shaders, create the pipelines, etc.
|
|
Self {
|
|
$($element: <$element_ty>::new(ctx),)+
|
|
}
|
|
}
|
|
|
|
$(pub fn $element(&self) -> &$element_ty {
|
|
&self.$element
|
|
})+
|
|
|
|
}
|
|
};
|
|
() => {};
|
|
}
|
|
|
|
elementvec!({
|
|
ppi, PPI
|
|
});
|