Quellcode durchsuchen

improved geometry API

Daniel Salvadori vor 7 Jahren
Ursprung
Commit
0611c73549
1 geänderte Dateien mit 12 neuen und 0 gelöschten Zeilen
  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 {