mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
graphics: Refactoring
This commit is contained in:
parent
aeaa877949
commit
c44ee9cde2
@ -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)
|
||||
|
@ -268,6 +268,3 @@ func (p *programContext) begin() error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *programContext) end() {
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user