mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +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()
|
_, h := c.dst.Size()
|
||||||
proj := f.projectionMatrix(h)
|
proj := f.projectionMatrix(h)
|
||||||
p := programContext{
|
p := &programContext{
|
||||||
state: &theOpenGLState,
|
state: &theOpenGLState,
|
||||||
program: theOpenGLState.programTexture,
|
program: theOpenGLState.programTexture,
|
||||||
context: context,
|
context: context,
|
||||||
@ -199,7 +199,6 @@ func (c *drawImageCommand) Exec(context *opengl.Context, indexOffsetInBytes int)
|
|||||||
if err := p.begin(); err != nil {
|
if err := p.begin(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer p.end()
|
|
||||||
// TODO: We should call glBindBuffer here?
|
// TODO: We should call glBindBuffer here?
|
||||||
// The buffer is already bound at begin() but it is counterintuitive.
|
// The buffer is already bound at begin() but it is counterintuitive.
|
||||||
context.DrawElements(opengl.Triangles, 6*n, indexOffsetInBytes)
|
context.DrawElements(opengl.Triangles, 6*n, indexOffsetInBytes)
|
||||||
|
@ -268,6 +268,3 @@ func (p *programContext) begin() error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *programContext) end() {
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user