SHARE
TWEET

Untitled

a guest Apr 19th, 2019 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @[Link(ldflags: "-L#{__DIR__} -lraylib -lglfw3 -lX11 -lm")]
  2. lib LibRaylib
  3.     struct Color
  4.         r : UInt8
  5.         g : UInt8
  6.         b : UInt8
  7.         a : UInt8
  8.     end
  9.  
  10.     fun InitWindow(width : Int32, height : Int32, title : LibC::Char*) : Void
  11.     fun WindowShouldClose() : Bool
  12.     fun BeginDrawing() : Void
  13.     fun EndDrawing() : Void
  14.     fun ClearBackground(color : Color) : Void
  15.     fun DrawText(text : LibC::Char*, posX : Int32, posY : Int32, fontSize : Int32, color : Color)
  16. end
  17.  
  18. LibRaylib.InitWindow(800, 600, "raylib-cr")
  19.  
  20. clear = LibRaylib::Color.new
  21. clear.r = 0
  22. clear.g = 0
  23. clear.b = 0
  24. clear.a = 255
  25.  
  26. text = LibRaylib::Color.new
  27. text.r = 240
  28. text.g = 240
  29. text.b = 240
  30. text.a = 255
  31.  
  32. until LibRaylib.WindowShouldClose
  33.     LibRaylib.BeginDrawing
  34.     LibRaylib.ClearBackground clear
  35.     LibRaylib.DrawText "Crystal Clear!", 10, 10, 20, text
  36.     LibRaylib.EndDrawing
  37. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top