From 95a925ec9ae66d6981666bda7d34b182b32c5162 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 4 Nov 2018 18:49:22 +0900 Subject: [PATCH] opengl: Refactoring --- internal/graphicscommand/command.go | 2 +- internal/opengl/program.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/graphicscommand/command.go b/internal/graphicscommand/command.go index 013139601..76f2148c5 100644 --- a/internal/graphicscommand/command.go +++ b/internal/graphicscommand/command.go @@ -245,7 +245,7 @@ func (c *drawImageCommand) Exec(indexOffsetInBytes int) error { proj := f.ProjectionMatrix() dw, dh := c.dst.Size() sw, sh := c.src.Size() - opengl.UseProgram(proj, c.src.image.Texture, dw, dh, sw, sh, c.color, c.filter) + opengl.UseProgram(proj, c.src.image, dw, dh, sw, sh, c.color, c.filter) opengl.GetContext().DrawElements(c.nindices, indexOffsetInBytes) // glFlush() might be necessary at least on MacBook Pro (a smilar problem at #419), diff --git a/internal/opengl/program.go b/internal/opengl/program.go index 77b08040d..3de084982 100644 --- a/internal/opengl/program.go +++ b/internal/opengl/program.go @@ -266,8 +266,8 @@ func BufferSubData(vertices []float32, indices []uint16) { c.elementArrayBufferSubData(indices) } -func UseProgram(proj []float32, texture Texture, dstW, dstH, srcW, srcH int, colorM *affine.ColorM, filter graphics.Filter) { - theOpenGLState.useProgram(proj, texture, dstW, dstH, srcW, srcH, colorM, filter) +func UseProgram(proj []float32, src *Image, dstW, dstH, srcW, srcH int, colorM *affine.ColorM, filter graphics.Filter) { + theOpenGLState.useProgram(proj, src.Texture, dstW, dstH, srcW, srcH, colorM, filter) } // useProgram uses the program (programTexture).