reorder methods of TrianglesData

This commit is contained in:
faiface 2017-01-26 23:40:29 +01:00
parent 0af28b0b17
commit e7a2af61fb
1 changed files with 10 additions and 10 deletions

View File

@ -13,16 +13,6 @@ type TrianglesData []struct {
Texture Vec
}
// Len returns the number of vertices in TrianglesData.
func (td *TrianglesData) Len() int {
return len(*td)
}
// Draw is unimplemented for TrianglesData and panics.
func (td *TrianglesData) Draw() {
panic(fmt.Errorf("%T.Draw: invalid operation", td))
}
// SetLen resizes TrianglesData to len, while keeping the original content.
//
// If len is greater than TrianglesData's current length, the new data is filled with default
@ -43,6 +33,16 @@ func (td *TrianglesData) SetLen(len int) {
}
}
// Len returns the number of vertices in TrianglesData.
func (td *TrianglesData) Len() int {
return len(*td)
}
// Draw is unimplemented for TrianglesData and panics.
func (td *TrianglesData) Draw() {
panic(fmt.Errorf("%T.Draw: invalid operation", td))
}
func (td *TrianglesData) updateData(offset int, t Triangles) {
// fast path optimization
if t, ok := t.(*TrianglesData); ok {