mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-12 22:17:26 +01:00
graphicscommand: Do not flush (glFlush) when commands are empty
Fixes #1140
This commit is contained in:
parent
2e2dc7fba4
commit
86c0e871e4
@ -175,6 +175,10 @@ func fract(x float32) float32 {
|
|||||||
|
|
||||||
// Flush flushes the command queue.
|
// Flush flushes the command queue.
|
||||||
func (q *commandQueue) Flush() error {
|
func (q *commandQueue) Flush() error {
|
||||||
|
if len(q.commands) == 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
es := q.indices
|
es := q.indices
|
||||||
vs := q.vertices
|
vs := q.vertices
|
||||||
if recordLog() {
|
if recordLog() {
|
||||||
@ -233,7 +237,6 @@ func (q *commandQueue) Flush() error {
|
|||||||
vs[i*graphics.VertexFloatNum+7] /= s.height
|
vs[i*graphics.VertexFloatNum+7] /= s.height
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
theGraphicsDriver.Begin()
|
theGraphicsDriver.Begin()
|
||||||
cs := q.commands
|
cs := q.commands
|
||||||
for len(cs) > 0 {
|
for len(cs) > 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user