graphics: Refactoring

This commit is contained in:
Hajime Hoshi 2016-12-29 01:15:57 +09:00
parent aeaa877949
commit c44ee9cde2
2 changed files with 1 additions and 5 deletions

View File

@ -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)

View File

@ -268,6 +268,3 @@ func (p *programContext) begin() error {
}
return nil
}
func (p *programContext) end() {
}