Ejemplo n.º 1
0
func (a *arrayBufferLayout) enable(c *opengl.Context, program opengl.Program) {
	for _, p := range a.parts {
		c.EnableVertexAttribArray(program, p.name)
	}
	total := a.totalBytes()
	offset := 0
	for _, p := range a.parts {
		c.VertexAttribPointer(program, p.name, p.num, p.dataType, p.normalize, total, offset)
		offset += p.dataType.SizeInBytes() * p.num
	}
}