v2 / examples / gg / sample_count.v
25 lines · 23 sloc · 598 bytes · bbb61ab3687afe512a1fa12492c876d011626107
Raw
1module main
2
3import gg
4import os
5
6fn main() {
7 scount := os.args[1] or { '2' }.int()
8 println('> sample count: ${scount}')
9 mut ctx := gg.new_context(
10 bg_color: gg.white
11 window_title: 'sample_count: ${scount}'
12 width: 320
13 height: 240
14 sample_count: scount
15 frame_fn: fn (mut ctx gg.Context) {
16 ctx.begin()
17 ctx.draw_rounded_rect_empty(110, 70, 100, 100, 10, gg.blue)
18 ctx.draw_circle_empty(160, 120, 100, gg.red)
19 ctx.draw_triangle_empty(160, 93, 186, 138, 132, 138, gg.green)
20 ctx.draw_rect_filled(159, 119, 2, 2, gg.black)
21 ctx.end()
22 }
23 )
24 ctx.run()
25}
26