Push lunch break code
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Failing after 25m26s
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Failing after 25m26s
This commit is contained in:
parent
9664ea754c
commit
1d333b633b
3 changed files with 45 additions and 0 deletions
10
src/core/render/material/mod.rs
Normal file
10
src/core/render/material/mod.rs
Normal file
|
@ -0,0 +1,10 @@
|
|||
pub mod triangle;
|
||||
|
||||
use vulkano::command_buffer::CommandBuffer;
|
||||
|
||||
use crate::vulkan::vulkan_context::VulkanContext;
|
||||
|
||||
pub trait Material {
|
||||
fn load(&self, vulkan_context: &VulkanContext);
|
||||
fn bind(&self, command_buffer: &mut CommandBuffer);
|
||||
}
|
34
src/core/render/material/triangle.rs
Normal file
34
src/core/render/material/triangle.rs
Normal file
|
@ -0,0 +1,34 @@
|
|||
use glam::Vec4;
|
||||
use vulkano::command_buffer::CommandBuffer;
|
||||
|
||||
use super::Material;
|
||||
|
||||
pub mod shaders {
|
||||
pub mod vs {
|
||||
vulkano_shaders::shader! {
|
||||
ty: "vertex",
|
||||
path: r"res/shaders/vertex.vert",
|
||||
}
|
||||
}
|
||||
|
||||
pub mod fs {
|
||||
vulkano_shaders::shader! {
|
||||
ty: "fragment",
|
||||
path: r"res/shaders/vertex.frag",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct TriangleMaterial {
|
||||
pub colors: [Vec4; 3],
|
||||
}
|
||||
|
||||
impl Material for TriangleMaterial {
|
||||
fn bind(&self, command_buffer: &mut CommandBuffer) {
|
||||
todo!()
|
||||
}
|
||||
|
||||
fn load(&self, vulkan_context: &crate::vulkan::vulkan_context::VulkanContext) {
|
||||
todo!()
|
||||
}
|
||||
}
|
|
@ -1,2 +1,3 @@
|
|||
pub mod material;
|
||||
pub mod mesh;
|
||||
pub mod vertex;
|
||||
|
|
Loading…
Add table
Reference in a new issue