mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 11:48:55 +01:00
graphicscommand: Do not flush (glFlush) when commands are empty
Fixes #1140
This commit is contained in:
parent
56ae207d2a
commit
9b8c547342
@ -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