Browse Source

improved geometry API

Daniel Salvadori 7 years ago
parent
commit
0611c73549
1 changed files with 12 additions and 0 deletions
  1. 12 0
      geometry/geometry.go

+ 12 - 0
geometry/geometry.go

@@ -195,6 +195,18 @@ func (g *Geometry) VBO(atype gls.AttribType) *gls.VBO {
 	return nil
 }
 
+// VBOName returns a pointer to this geometry's VBO which contain the specified attribute.
+// Returns nil if the VBO is not found.
+func (g *Geometry) VBOName(name string) *gls.VBO {
+
+	for _, vbo := range g.vbos {
+		if vbo.AttribName(name) != nil {
+			return vbo
+		}
+	}
+	return nil
+}
+
 // VBOs returns all of this geometry's VBOs.
 func (g *Geometry) VBOs() []*gls.VBO {