MCPcopy
hub / github.com/g3n/engine / AddVBO

Method AddVBO

geometry/geometry.go:132–147  ·  view source on GitHub ↗

AddVBO adds a Vertex Buffer Object for this geometry.

(vbo *gls.VBO)

Source from the content-addressed store, hash-verified

130
131// AddVBO adds a Vertex Buffer Object for this geometry.
132func (g *Geometry) AddVBO(vbo *gls.VBO) {
133
134 // Check that the provided VBO doesn't have conflicting attributes with existing VBOs
135 for _, existingVbo := range g.vbos {
136 for _, attrib := range vbo.Attributes() {
137 if existingVbo.AttribName(attrib.Name) != nil {
138 panic("Geometry.AddVBO: geometry already has a VBO with attribute name:" + attrib.Name)
139 }
140 if attrib.Type != gls.Undefined && existingVbo.Attrib(attrib.Type) != nil {
141 panic("Geometry.AddVBO: geometry already has a VBO with attribute type:" + strconv.Itoa(int(attrib.Type)))
142 }
143 }
144 }
145
146 g.vbos = append(g.vbos, vbo)
147}
148
149// VBO returns a pointer to this geometry's VBO which contain the specified attribute.
150// Returns nil if the VBO is not found.

Callers 15

NewSpriteFunction · 0.95
NewSegmentedPlaneFunction · 0.95
NewDiskSectorFunction · 0.95
NewRibbonFunction · 0.95
NewSphereSectorFunction · 0.95
NewSegmentedBoxFunction · 0.95
NewTruncatedConeSectorFunction · 0.95
NewTorusFunction · 0.95
newChartScaleXFunction · 0.95
newChartScaleYFunction · 0.95
newGraphFunction · 0.95
InitializeMethod · 0.95

Calls 3

AttributesMethod · 0.80
AttribNameMethod · 0.80
AttribMethod · 0.80

Tested by

no test coverage detected