AddVBO adds a Vertex Buffer Object for this geometry.
(vbo *gls.VBO)
| 130 | |
| 131 | // AddVBO adds a Vertex Buffer Object for this geometry. |
| 132 | func (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. |
no test coverage detected