summaryrefslogtreecommitdiff
path: root/engine/src/object.rs
diff options
context:
space:
mode:
Diffstat (limited to 'engine/src/object.rs')
-rw-r--r--engine/src/object.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/engine/src/object.rs b/engine/src/object.rs
index c3d82d0..02ae97a 100644
--- a/engine/src/object.rs
+++ b/engine/src/object.rs
@@ -23,7 +23,11 @@ impl Object
///
/// # Errors
/// Will return `Err` if shader creation fails or if shader program linking fails.
- pub fn new(id: Id, vertices: &[Vertex]) -> Result<Self, Error>
+ pub fn new(
+ id: Id,
+ vertices: &[Vertex],
+ indices: Option<&[u32]>,
+ ) -> Result<Self, Error>
{
let vertex_shader = Shader::new(ShaderKind::Vertex);
@@ -54,7 +58,7 @@ impl Object
.link()
.map_err(Error::LinkShaderProgramFailed)?;
- let renderable = Renderable::new(shader_program, vertices);
+ let renderable = Renderable::new(shader_program, vertices, indices);
let transform = Transform::new();