Created
April 9, 2019 11:19
-
-
Save AregevDev/56af95beff017300025cfb14e46b368f to your computer and use it in GitHub Desktop.
raylib-cr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@[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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment