reorder methods of TrianglesData
This commit is contained in:
parent
0af28b0b17
commit
e7a2af61fb
20
graphics.go
20
graphics.go
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue