diff --git a/src/core/render/material/mod.rs b/src/core/render/material/mod.rs new file mode 100644 index 0000000..8cccde2 --- /dev/null +++ b/src/core/render/material/mod.rs @@ -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); +} diff --git a/src/core/render/material/triangle.rs b/src/core/render/material/triangle.rs new file mode 100644 index 0000000..c3bafaa --- /dev/null +++ b/src/core/render/material/triangle.rs @@ -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!() + } +} diff --git a/src/core/render/mod.rs b/src/core/render/mod.rs index 6f29814..5d003a8 100644 --- a/src/core/render/mod.rs +++ b/src/core/render/mod.rs @@ -1,2 +1,3 @@ +pub mod material; pub mod mesh; pub mod vertex;