Advertisement
spytheman123

example of hiding the OS mouse cursor with GG

Jul 4th, 2025 (edited)
521
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VeriLog 0.43 KB | Source Code | 0 0
  1. import gg
  2. import gx
  3. import sokol.sapp
  4.  
  5. fn main() {
  6.     mut ctx := gg.new_context(
  7.         width:        800
  8.         height:       600
  9.         window_title: 'Follow mouse cursor'
  10.         bg_color:     gx.light_blue
  11.         frame_fn:     frame
  12.         init_fn:      fn (x voidptr) {
  13.             sapp.show_mouse(false)
  14.         }
  15.     )
  16.     ctx.run()
  17. }
  18.  
  19. fn frame(mut ctx gg.Context) {
  20.     ctx.begin()
  21.     ctx.draw_rect_filled(ctx.mouse_pos_x, ctx.mouse_pos_y, 50, 50, gx.red)
  22.     ctx.end()
  23. }
  24.  
Tags: Gg vlang sokol
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement