minimal logging
This commit is contained in:
@@ -148,8 +148,9 @@ impl RenderState {
|
||||
|
||||
}
|
||||
|
||||
pub fn load_mesh_to_buffer(&self, filepath: &str, color: Option<wgpu::Color>) -> Mesh {
|
||||
let raw_mesh = load_obj(filepath);
|
||||
pub fn load_mesh_to_buffer(&self, filepath: &str, color: Option<wgpu::Color>) -> Result<Mesh, String> {
|
||||
|
||||
let raw_mesh = load_obj(filepath)?;
|
||||
let index_count = raw_mesh.indices.len() * 3; // TODO bad bad bad bad!
|
||||
|
||||
let (vertex_buf, index_buf) = RenderState::create_buffer(&self.device, raw_mesh);
|
||||
@@ -176,7 +177,7 @@ impl RenderState {
|
||||
}],
|
||||
}));
|
||||
|
||||
Mesh {
|
||||
Ok(Mesh {
|
||||
index_buffer: index_buf,
|
||||
index_count: index_count,
|
||||
// TODO: This is hardcoded by tobj, maybe think about doing something a little more clever?
|
||||
@@ -185,7 +186,7 @@ impl RenderState {
|
||||
uniform_buffer: uniform_buf,
|
||||
bind_group: bind_group,
|
||||
color: color.unwrap_or(wgpu::Color::RED),
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/// When creating a light we have to give it a target view to render to
|
||||
|
||||
Reference in New Issue
Block a user