driver: Refactoring: Remove Graphics.Flush

Updates #226
This commit is contained in:
Hajime Hoshi 2019-12-06 08:42:52 +09:00
parent 7991ba4cfa
commit c9bc5913fd
4 changed files with 3 additions and 14 deletions

View File

@ -28,7 +28,6 @@ type Graphics interface {
SetWindow(window unsafe.Pointer)
SetTransparent(transparent bool)
SetVertices(vertices []float32, indices []uint16)
Flush()
NewImage(width, height int) (Image, error)
NewScreenFramebufferImage(width, height int) (Image, error)
Reset() error

View File

@ -274,10 +274,6 @@ func (q *commandQueue) Flush() {
// introduced than drawTrianglesCommand.
indexOffset += c.NumIndices()
}
if 0 < nc {
// Call glFlush to prevent black flicking (especially on Android (#226) and iOS).
theGraphicsDriver.Flush()
}
cs = cs[nc:]
}
theGraphicsDriver.End()

View File

@ -364,10 +364,6 @@ func (d *Driver) SetVertices(vertices []float32, indices []uint16) {
})
}
func (d *Driver) Flush() {
// On Metal, flushing command buffers only once is enough except for manipulating pixels. Do not call flush.
}
func (d *Driver) flush(wait bool, present bool) {
d.t.Call(func() error {
if d.cb == (mtl.CommandBuffer{}) {

View File

@ -47,7 +47,9 @@ func (d *Driver) Begin() {
}
func (d *Driver) End() {
// Do nothing.
// Call glFlush to prevent black flicking (especially on Android (#226) and iOS).
// TODO: examples/sprites worked without this. Is this really needed?
d.context.flush()
}
func (d *Driver) SetWindow(window unsafe.Pointer) {
@ -128,10 +130,6 @@ func (d *Driver) Draw(indexLen int, indexOffset int, mode driver.CompositeMode,
return nil
}
func (d *Driver) Flush() {
d.context.flush()
}
func (d *Driver) SetVsyncEnabled(enabled bool) {
// Do nothing
}