graphicsdriver: Rename BufferSubData -> SetVertices

This commit is contained in:
Hajime Hoshi 2018-11-11 23:54:58 +09:00
parent 846a719d6c
commit 907a28c434
3 changed files with 6 additions and 6 deletions

View File

@ -165,10 +165,7 @@ func (q *commandQueue) Flush() {
nc++ nc++
} }
if 0 < ne { if 0 < ne {
// Note that the vertices passed to BufferSubData is not under GC management driver().SetVertices(vs[:nv], es[:ne])
// in opengl package due to unsafe-way.
// See BufferSubData in context_mobile.go.
driver().BufferSubData(vs[:nv], es[:ne])
es = es[ne:] es = es[ne:]
vs = vs[nv:] vs = vs[nv:]
} }

View File

@ -20,7 +20,7 @@ import (
) )
type GraphicsDriver interface { type GraphicsDriver interface {
BufferSubData(vertices []float32, indices []uint16) SetVertices(vertices []float32, indices []uint16)
Flush() Flush()
MaxImageSize() int MaxImageSize() int
NewImage(width, height int) (Image, error) NewImage(width, height int) (Image, error)

View File

@ -86,7 +86,10 @@ func (d *Driver) Reset() error {
return d.state.reset(&d.context) return d.state.reset(&d.context)
} }
func (d *Driver) BufferSubData(vertices []float32, indices []uint16) { func (d *Driver) SetVertices(vertices []float32, indices []uint16) {
// Note that the vertices passed to BufferSubData is not under GC management
// in opengl package due to unsafe-way.
// See BufferSubData in context_mobile.go.
d.context.arrayBufferSubData(vertices) d.context.arrayBufferSubData(vertices)
d.context.elementArrayBufferSubData(indices) d.context.elementArrayBufferSubData(indices)
} }