mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
parent
53d7bcda84
commit
e7fafb5527
@ -1,4 +1,4 @@
|
||||
// Copyright 2018 The Ebiten Authors
|
||||
// Copyright 2020 The Ebiten Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
@ -14,8 +14,12 @@
|
||||
|
||||
// +build ebitendebug
|
||||
|
||||
package graphicscommand
|
||||
package debug
|
||||
|
||||
func recordLog() bool {
|
||||
return true
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func Logf(format string, args ...interface{}) {
|
||||
fmt.Printf(format, args...)
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
// Copyright 2018 The Ebiten Authors
|
||||
// Copyright 2020 The Ebiten Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
@ -14,8 +14,7 @@
|
||||
|
||||
// +build !ebitendebug
|
||||
|
||||
package graphicscommand
|
||||
package debug
|
||||
|
||||
func recordLog() bool {
|
||||
return false
|
||||
func Logf(format string, args ...interface{}) {
|
||||
}
|
@ -20,6 +20,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/hajimehoshi/ebiten/v2/internal/affine"
|
||||
"github.com/hajimehoshi/ebiten/v2/internal/debug"
|
||||
"github.com/hajimehoshi/ebiten/v2/internal/driver"
|
||||
"github.com/hajimehoshi/ebiten/v2/internal/graphics"
|
||||
"github.com/hajimehoshi/ebiten/v2/internal/shaderir"
|
||||
@ -214,9 +215,7 @@ func (q *commandQueue) flush() error {
|
||||
|
||||
es := q.indices
|
||||
vs := q.vertices
|
||||
if recordLog() {
|
||||
fmt.Println("--")
|
||||
}
|
||||
debug.Logf("--\nGraphics commands:\n")
|
||||
|
||||
if theGraphicsDriver.HasHighPrecisionFloat() {
|
||||
n := q.nvertices / graphics.VertexFloatNum
|
||||
@ -283,9 +282,7 @@ func (q *commandQueue) flush() error {
|
||||
if err := c.Exec(indexOffset); err != nil {
|
||||
return err
|
||||
}
|
||||
if recordLog() {
|
||||
fmt.Printf("%s\n", c)
|
||||
}
|
||||
debug.Logf(" %s\n", c)
|
||||
// TODO: indexOffset should be reset if the command type is different
|
||||
// from the previous one. This fix is needed when another drawing command is
|
||||
// introduced than drawTrianglesCommand.
|
||||
|
@ -22,6 +22,7 @@ import (
|
||||
|
||||
"github.com/hajimehoshi/ebiten/v2/internal/buffered"
|
||||
"github.com/hajimehoshi/ebiten/v2/internal/clock"
|
||||
"github.com/hajimehoshi/ebiten/v2/internal/debug"
|
||||
"github.com/hajimehoshi/ebiten/v2/internal/driver"
|
||||
"github.com/hajimehoshi/ebiten/v2/internal/hooks"
|
||||
)
|
||||
@ -161,6 +162,7 @@ func (c *uiContext) update() error {
|
||||
updateCount = 1
|
||||
c.updateCalled = true
|
||||
}
|
||||
debug.Logf("--\nUpdate count per frame: %d\n", updateCount)
|
||||
|
||||
for i := 0; i < updateCount; i++ {
|
||||
if err := hooks.RunBeforeUpdateHooks(); err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user