refactor debug info, measure render times
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"edgaru089.ml/go/gl01/internal/igwrap/backend"
|
||||
"edgaru089.ml/go/gl01/internal/io"
|
||||
"edgaru089.ml/go/gl01/internal/render"
|
||||
"edgaru089.ml/go/gl01/internal/util"
|
||||
"edgaru089.ml/go/gl01/internal/util/itype"
|
||||
"edgaru089.ml/go/gl01/internal/world"
|
||||
"edgaru089.ml/go/gl01/internal/world/worldgen"
|
||||
@@ -174,7 +175,8 @@ const airAccel = 0.1
|
||||
// Update updates the game state, not necessarily in the main thread.
|
||||
func (g *Game) Update(win *glfw.Window, delta time.Duration) {
|
||||
backend.NewFrame()
|
||||
imgui.ShowDemoWindow(nil)
|
||||
|
||||
clock := util.NewClock()
|
||||
|
||||
if !g.paused {
|
||||
|
||||
@@ -242,7 +244,12 @@ func (g *Game) Update(win *glfw.Window, delta time.Duration) {
|
||||
g.player.SetSpeed(itype.Vec3d{})
|
||||
}
|
||||
|
||||
io.Diagnostics.Times.Logic = clock.Restart()
|
||||
|
||||
imgui.ShowDemoWindow(nil)
|
||||
g.imgui()
|
||||
|
||||
io.Diagnostics.Times.GUI = clock.Restart()
|
||||
}
|
||||
|
||||
// Render, called with a OpenGL context, renders the game.
|
||||
|
||||
Reference in New Issue
Block a user