| 1 | module main |
| 2 | |
| 3 | import gg |
| 4 | import sokol.sapp |
| 5 | |
| 6 | fn main() { |
| 7 | mut ctx := gg.new_context( |
| 8 | bg_color: gg.white |
| 9 | window_title: 'Cursor' |
| 10 | frame_fn: frame |
| 11 | init_fn: init |
| 12 | ) |
| 13 | ctx.run() |
| 14 | } |
| 15 | |
| 16 | fn init(mut _ctx gg.Context) { |
| 17 | sapp.set_mouse_cursor(.ibeam) |
| 18 | } |
| 19 | |
| 20 | fn frame(mut ctx gg.Context) { |
| 21 | ctx.begin() |
| 22 | ctx.draw_text_def(10, 25, 'Your cursor should be an I shaped beam.') |
| 23 | ctx.end() |
| 24 | } |
| 25 |