Advertisement
spytheman123

Cool lines drawn with V's gg module.

Aug 17th, 2023 (edited)
1,299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VeriLog 0.53 KB | Source Code | 0 0
  1. module main
  2.  
  3. import gg
  4. import gx
  5.  
  6. fn main() {
  7.     mut ctx := gg.new_context(
  8.         bg_color: gx.white
  9.         width: 600
  10.         height: 780
  11.         create_window: true
  12.         window_title: 'Lines'
  13.         frame_fn: frame
  14.         sample_count: 4
  15.     )
  16.     ctx.run()
  17. }
  18.  
  19. fn frame(mut ctx gg.Context) {
  20.     window_size := ctx.window_size()
  21.     ctx.begin()
  22.     for l := 30; l <= window_size.height; l += window_size.height / 10 {
  23.         for r := 30; r <= window_size.height; r += window_size.height / 10 {
  24.             ctx.draw_line(10, l, window_size.width - 10, r, gx.black)
  25.         }
  26.     }
  27.     ctx.end()
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement