mirror of
https://github.com/IllusionMan1212/O2048.git
synced 2026-10-24 10:12:37 +00:00
initial
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
package zephr
|
||||
|
||||
import "core:fmt"
|
||||
import "core:time"
|
||||
|
||||
TimerState :: enum {
|
||||
RUNNING,
|
||||
PAUSED,
|
||||
STOPPED,
|
||||
}
|
||||
|
||||
Timer :: struct {
|
||||
start: f64,
|
||||
elapsed: f64,
|
||||
duration: f32,
|
||||
state: TimerState,
|
||||
}
|
||||
|
||||
@private
|
||||
TIMER : time.Stopwatch
|
||||
|
||||
@private
|
||||
start_internal_timer :: proc() {
|
||||
time.stopwatch_start(&TIMER)
|
||||
}
|
||||
|
||||
get_time :: proc() -> time.Duration {
|
||||
return time.stopwatch_duration(TIMER)
|
||||
}
|
||||
|
||||
start_timer :: proc(timer: ^time.Stopwatch) {
|
||||
time.stopwatch_start(timer)
|
||||
}
|
||||
|
||||
// TODO: incomplete
|
||||
Reference in New Issue
Block a user