Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @[Link(ldflags: "-L#{__DIR__} -lraylib -lglfw3 -lX11 -lm")]
- lib LibRaylib
- struct Color
- r : UInt8
- g : UInt8
- b : UInt8
- a : UInt8
- end
- fun InitWindow(width : Int32, height : Int32, title : LibC::Char*) : Void
- fun WindowShouldClose() : Bool
- fun BeginDrawing() : Void
- fun EndDrawing() : Void
- fun ClearBackground(color : Color) : Void
- fun DrawText(text : LibC::Char*, posX : Int32, posY : Int32, fontSize : Int32, color : Color)
- end
- LibRaylib.InitWindow(800, 600, "raylib-cr")
- clear = LibRaylib::Color.new
- clear.r = 0
- clear.g = 0
- clear.b = 0
- clear.a = 255
- text = LibRaylib::Color.new
- text.r = 240
- text.g = 240
- text.b = 240
- text.a = 255
- until LibRaylib.WindowShouldClose
- LibRaylib.BeginDrawing
- LibRaylib.ClearBackground clear
- LibRaylib.DrawText "Crystal Clear!", 10, 10, 20, text
- LibRaylib.EndDrawing
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement