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
package main
import "core:fmt"
import gpu "../.."
main :: proc() {
ctx := gpu.init_context(width = 320, height = 240)
frame := gpu.begin_frame(ctx)
defer gpu.destroy_frame(&frame)
target := gpu.begin_target(&frame, gpu.present_target(ctx))
_ = gpu.push_layer(&frame, {name = "ui", sort_base = 10_000, order = .Strict})
_ = gpu.draw_rect(&frame, {
x = 16,
y = 16,
width = 64,
height = 32,
color = gpu.WHITE,
})
_ = gpu.draw_text_run(&frame, {
glyphs = []gpu.Glyph_Quad{
{x = 24, y = 24, width = 6, height = 8, u0 = 0, v0 = 0, u1 = 1, v1 = 1, color = gpu.WHITE},
},
sort_key = 1,
})
gpu.end_target(&frame, target)
if !gpu.submit(&frame) {
fmt.println("frame_intent: submit validation failed")
return
}
fmt.println("frame_intent: built frame intent")
}