Arkadodge/state.odin

16 lines
201 B
Odin
Raw Normal View History

2024-09-04 22:43:27 +03:00
package main
GameState :: struct {
update: proc(f32),
draw: proc(),
variant: union{^Game, ^Menu}
}
new_state :: proc($T: typeid) -> ^T {
state := new(T)
state.variant = state
return state
}