From b2b51fb1bf70d48911c4d71ed50bdc0e69ddb6dd Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 11 Nov 2018 22:08:36 +0900 Subject: [PATCH] graphicsdriver/opengl: Refactoring --- internal/graphicsdriver/opengl/driver.go | 3 ++- internal/graphicsdriver/opengl/program.go | 5 ----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/internal/graphicsdriver/opengl/driver.go b/internal/graphicsdriver/opengl/driver.go index 85e61fe99..307600023 100644 --- a/internal/graphicsdriver/opengl/driver.go +++ b/internal/graphicsdriver/opengl/driver.go @@ -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 { diff --git a/internal/graphicsdriver/opengl/program.go b/internal/graphicsdriver/opengl/program.go index 2e6efc084..ca72103f2 100644 --- a/internal/graphicsdriver/opengl/program.go +++ b/internal/graphicsdriver/opengl/program.go @@ -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