From c44ee9cde2807b497c2e3f18d729916c88e99b85 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Thu, 29 Dec 2016 01:15:57 +0900 Subject: [PATCH] graphics: Refactoring --- internal/graphics/command.go | 3 +-- internal/graphics/program.go | 3 --- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/internal/graphics/command.go b/internal/graphics/command.go index 679eca3af..fcd9ad9ba 100644 --- a/internal/graphics/command.go +++ b/internal/graphics/command.go @@ -188,7 +188,7 @@ func (c *drawImageCommand) Exec(context *opengl.Context, indexOffsetInBytes int) } _, h := c.dst.Size() proj := f.projectionMatrix(h) - p := programContext{ + p := &programContext{ state: &theOpenGLState, program: theOpenGLState.programTexture, context: context, @@ -199,7 +199,6 @@ func (c *drawImageCommand) Exec(context *opengl.Context, indexOffsetInBytes int) if err := p.begin(); err != nil { return err } - defer p.end() // TODO: We should call glBindBuffer here? // The buffer is already bound at begin() but it is counterintuitive. context.DrawElements(opengl.Triangles, 6*n, indexOffsetInBytes) diff --git a/internal/graphics/program.go b/internal/graphics/program.go index 1d8a96fb8..dc246633a 100644 --- a/internal/graphics/program.go +++ b/internal/graphics/program.go @@ -268,6 +268,3 @@ func (p *programContext) begin() error { } return nil } - -func (p *programContext) end() { -}