Example #1
0
func (emitter *particleEmitter) Buffer() {
	data := emitter.Bytes()
	if len(data) > 0 {
		gl.BindBuffer(gl.ARRAY_BUFFER, emitter.VBO)
		gl.BufferSubData(gl.ARRAY_BUFFER, 0, data)
	}
}
Example #2
0
func (shape *DynamicShape) Buffer(offset int) {
	gl.BindBuffer(gl.ARRAY_BUFFER, shape.VBO)
	data := shape.BytesOffset(offset)
	if len(data) == 0 {
		return
	}
	gl.BufferSubData(gl.ARRAY_BUFFER, offset*shape.Stride(), data)
}
Example #3
0
func (shape *Line) Buffer(offset int) {
	data := shape.BytesOffset(offset)
	if len(data) == 0 {
		return
	}
	gl.BindBuffer(gl.ARRAY_BUFFER, shape.VBO)
	gl.BufferSubData(gl.ARRAY_BUFFER, lineEmittedVertices*offset*shape.Stride(), data)
}