igwrap: fix DeltaTime less than 0 on Windows
This commit is contained in:
parent
b44d41ec66
commit
f4f784a7d3
@ -38,7 +38,11 @@ func NewFrame() {
|
|||||||
io.SetDisplaySize(imgui.Vec2{X: float32(dsx), Y: float32(dsy)})
|
io.SetDisplaySize(imgui.Vec2{X: float32(dsx), Y: float32(dsy)})
|
||||||
|
|
||||||
now := time.Now()
|
now := time.Now()
|
||||||
io.SetDeltaTime(float32(time.Since(lastframe).Seconds()))
|
deltaTime := float32(time.Since(lastframe).Seconds())
|
||||||
|
if deltaTime <= 0.0 {
|
||||||
|
deltaTime = 1e-6
|
||||||
|
}
|
||||||
|
io.SetDeltaTime(deltaTime)
|
||||||
lastframe = now
|
lastframe = now
|
||||||
|
|
||||||
if win.GetAttrib(glfw.Focused) != 0 {
|
if win.GetAttrib(glfw.Focused) != 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user