MCPcopy Index your code
hub / github.com/EngoEngine/engo / Update

Method Update

common/fps.go:77–92  ·  view source on GitHub ↗

Update changes the dipslayed text and prints to the terminal every second to report the FPS

(dt float32)

Source from the content-addressed store, hash-verified

75// Update changes the dipslayed text and prints to the terminal every second
76// to report the FPS
77func (f *FPSSystem) Update(dt float32) {
78 f.elapsed += dt
79 text := f.DisplayString()
80 if f.elapsed >= 1 {
81 if f.Display {
82 f.entity.Drawable = Text{
83 Font: f.Font,
84 Text: text,
85 }
86 }
87 if f.Terminal {
88 log.Println(text)
89 }
90 f.elapsed--
91 }
92}
93
94// DisplayString returns the display string in the format FPS: 60
95func (f *FPSSystem) DisplayString() string {

Callers

nothing calls this directly

Calls 1

DisplayStringMethod · 0.95

Tested by

no test coverage detected