47 lines
568 B
V
47 lines
568 B
V
module main
|
|
|
|
import time
|
|
|
|
fn main() {
|
|
println("main()")
|
|
|
|
mut f := new_field()
|
|
|
|
f.generate(4, 4)
|
|
|
|
f.cells[1][1].z = 100
|
|
println("z 0 0: ${f.cells[0][0].z}")
|
|
println("z 1 1: ${f.cells[1][1].z}")
|
|
|
|
|
|
mut ctx := new_context()
|
|
|
|
|
|
mut app := new_app(mut ctx)
|
|
|
|
app.init(800, 600, "auts")
|
|
|
|
//d := new_drawer(mut ctx)
|
|
mut d := ctx.drawer
|
|
|
|
tex := d.load_image_tex("res/images/heightmap.png")
|
|
|
|
for app.step() {
|
|
//app.step()
|
|
|
|
d.clear()
|
|
|
|
d.draw_tex(tex, 0, 0)
|
|
|
|
app.flip()
|
|
|
|
//time.sleep_ms(20)
|
|
time.sleep_ms(200)
|
|
//pp(2)
|
|
}
|
|
|
|
app.quit()
|
|
|
|
println("done")
|
|
}
|