From 1c0c8f788c8125c90a097e5241b5e8fe2518d1d2 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sun, 5 Jan 2025 23:24:57 +0100 Subject: a --- client/src/part.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'client/src/part.rs') diff --git a/client/src/part.rs b/client/src/part.rs index 0ad714a..7d02f0c 100644 --- a/client/src/part.rs +++ b/client/src/part.rs @@ -12,13 +12,18 @@ use wgpu::{ util::{BufferInitDescriptor, DeviceExt}, }; -pub struct RenderPart { +pub struct PartRenderer { vertex: Buffer, index: Buffer, pipeline: RenderPipeline, bind_group: BindGroup, n_vertex: u32, } + +pub struct PrefabData { + +} + pub struct PartData { target: Part, vertex: Vec>, @@ -48,7 +53,7 @@ impl PartData { } } -impl RenderPart { +impl PartRenderer { pub fn new(device: Device, data: PartData, format: TextureFormat) -> Self { let mut vertex = Vec::new(); let mut index = Vec::new(); @@ -140,7 +145,7 @@ impl RenderPart { n_vertex, } } - pub fn draw(&self, commands: &mut CommandEncoder, target: TextureView) { + pub fn draw(&self, commands: &mut CommandEncoder, target: &TextureView) { let mut rpass = commands.begin_render_pass(&RenderPassDescriptor { label: None, color_attachments: &[Some(RenderPassColorAttachment { -- cgit v1.2.3-70-g09d2