Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import gg
- import gx
- import sokol.sapp
- fn main() {
- mut ctx := gg.new_context(
- width: 800
- height: 600
- window_title: 'Follow mouse cursor'
- bg_color: gx.light_blue
- frame_fn: frame
- init_fn: fn (x voidptr) {
- sapp.show_mouse(false)
- }
- )
- ctx.run()
- }
- fn frame(mut ctx gg.Context) {
- ctx.begin()
- ctx.draw_rect_filled(ctx.mouse_pos_x, ctx.mouse_pos_y, 50, 50, gx.red)
- ctx.end()
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement