graphicsdriver/opengl: Refactoring

This commit is contained in:
Hajime Hoshi 2018-11-11 22:08:36 +09:00
parent aff77d98e4
commit b2b51fb1bf
2 changed files with 2 additions and 6 deletions

View File

@ -87,7 +87,8 @@ func (d *Driver) Reset() error {
}
func (d *Driver) BufferSubData(vertices []float32, indices []uint16) {
bufferSubData(&d.context, vertices, indices)
d.context.arrayBufferSubData(vertices)
d.context.elementArrayBufferSubData(indices)
}
func (d *Driver) UseProgram(mode graphics.CompositeMode, colorM *affine.ColorM, filter graphics.Filter) error {

View File

@ -253,11 +253,6 @@ func areSameFloat32Array(a, b []float32) bool {
return true
}
func bufferSubData(context *context, vertices []float32, indices []uint16) {
context.arrayBufferSubData(vertices)
context.elementArrayBufferSubData(indices)
}
// useProgram uses the program (programTexture).
func (d *Driver) useProgram(mode graphics.CompositeMode, colorM *affine.ColorM, filter graphics.Filter) error {
destination := d.state.destination