Avoid suffixe type by Type
This commit is contained in:
parent
cc64efd96f
commit
c2b9c2363b
3 changed files with 12 additions and 12 deletions
|
@ -52,10 +52,10 @@ pub trait AsRecordable {
|
|||
}
|
||||
|
||||
pub trait AsRenderableMesh {
|
||||
type VertexBufferContentsType: BufferContents + Clone;
|
||||
type IndexBufferType: Into<IndexBuffer> + Clone;
|
||||
type VertexBufferContents: BufferContents + Clone;
|
||||
type IndexBuffer: Into<IndexBuffer> + Clone;
|
||||
|
||||
fn vertex_buffer(&self) -> &Subbuffer<[Self::VertexBufferContentsType]>;
|
||||
fn vertex_buffer(&self) -> &Subbuffer<[Self::VertexBufferContents]>;
|
||||
|
||||
fn vertex_count(&self) -> u32;
|
||||
|
||||
|
@ -67,7 +67,7 @@ pub trait AsRenderableMesh {
|
|||
0
|
||||
}
|
||||
|
||||
fn index_buffer(&self) -> Option<&Self::IndexBufferType> {
|
||||
fn index_buffer(&self) -> Option<&Self::IndexBuffer> {
|
||||
None
|
||||
}
|
||||
|
||||
|
|
|
@ -58,14 +58,14 @@ impl ObjMesh {
|
|||
}
|
||||
|
||||
impl AsRenderableMesh for ObjMesh {
|
||||
type VertexBufferContentsType = Vertex3D;
|
||||
type IndexBufferType = Subbuffer<[u32]>;
|
||||
type VertexBufferContents = Vertex3D;
|
||||
type IndexBuffer = Subbuffer<[u32]>;
|
||||
|
||||
fn vertex_buffer(&self) -> &Subbuffer<[Self::VertexBufferContentsType]> {
|
||||
fn vertex_buffer(&self) -> &Subbuffer<[Self::VertexBufferContents]> {
|
||||
&self.vertex_buffer
|
||||
}
|
||||
|
||||
fn index_buffer(&self) -> Option<&Self::IndexBufferType> {
|
||||
fn index_buffer(&self) -> Option<&Self::IndexBuffer> {
|
||||
Some(&self.index_buffer)
|
||||
}
|
||||
|
||||
|
|
|
@ -45,14 +45,14 @@ impl SquareMesh {
|
|||
}
|
||||
|
||||
impl AsRenderableMesh for SquareMesh {
|
||||
type VertexBufferContentsType = Vertex3D;
|
||||
type IndexBufferType = Subbuffer<[u32]>;
|
||||
type VertexBufferContents = Vertex3D;
|
||||
type IndexBuffer = Subbuffer<[u32]>;
|
||||
|
||||
fn vertex_buffer(&self) -> &Subbuffer<[Self::VertexBufferContentsType]> {
|
||||
fn vertex_buffer(&self) -> &Subbuffer<[Self::VertexBufferContents]> {
|
||||
&self.vertex_buffer
|
||||
}
|
||||
|
||||
fn index_buffer(&self) -> Option<&Self::IndexBufferType> {
|
||||
fn index_buffer(&self) -> Option<&Self::IndexBuffer> {
|
||||
Some(&self.index_buffer)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue