1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package main
import gpu "../.."
import app "../../app"
main :: proc() {
state, ok := app.init_window(800, 600, "GPU - Frame Rects")
if !ok {
return
}
defer app.shutdown(&state)
for !app.window_should_close(&state) {
frame := app.begin_frame(&state, gpu.CORNFLOWER_BLUE)
_ = gpu.draw_rect(&frame, {
x = 50,
y = 50,
width = 200,
height = 100,
color = gpu.RED,
})
_ = gpu.draw_rect(&frame, {
x = 300,
y = 50,
width = 150,
height = 150,
color = gpu.GREEN,
})
_ = app.submit_frame(&state, &frame)
if app.is_key_pressed(&state, .Escape) {
break
}
}
}