frame

package
v0.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Delta

type Delta struct {
	time.Time
	// contains filtered or unexported fields
}

Delta is delta time messuring

func (Delta) Init

func (d Delta) Init() Delta

Init initializes delta to get rid of firs very long frame

func (*Delta) Log

func (d *Delta) Log(interval float64)

Log logs fps to console every interval (in seconds)

func (*Delta) Tick

func (d *Delta) Tick() float64

Tick updates delta

type Limitter

type Limitter struct {
	// contains filtered or unexported fields
}

Limitter controls frame count per second, by deafult limmiter does nothing fps has to be set

func (*Limitter) Regulate

func (l *Limitter) Regulate()

Regulate performs frame regulation (call every frame)

func (*Limitter) SetFPS

func (l *Limitter) SetFPS(fps int)

SetFPS sets fps to be limited to a given value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL