mach-raylib
Mach bindings for Raylib
Create new project
You can choose one of the two methods to add mach-raylib and run mach dep pull
mach dep add . raylib --git https://github.com/Angluca/mach-raylib --ref branch/main
Or write it to mach.toml
[dep .raylib ]
git = " https://github.com/angluca/mach-raylib"
ref = " branch/main"
write main.mach
use std. runtime;
use raylib. ra; # ra is composed of raylib/raymath/rcamera
#[ symbol( "main" ) ]
fun main( argc: i64 , argv: * * u8) i64 {
val sw: i32 = 200 ;
val sh: i32 = 150 ;
ra. init_window ( sw, sh, "^^v" ) ;
ra. set_target_fps ( 60 ) ;
val color: ra. Color = ra. Color { r: 200 , g: 100 , b: 90 , a: 255 } ;
for ( !ra. window_should_close ( ) ) {
ra. begin_drawing ( ) ;
ra. clear_background ( ra. LIGHTGRAY ) ;
ra. draw_text ( "Mach" , 40 , 76 , 40 , color) ;
ra. draw_text ( "raylib" , 72 , 100 , 40 , ra. BLACK ) ;
ra. end_drawing ( ) ;
}
ra. close_window ( ) ;
ret 0 ;
}
Download or build Raylib Library
build and run it
# mach build . -L lib_path --profile release
mach build . -L lib_path
# or
mach build . -L lib_path -l libname.a or .dylib or name
mach run .
mach-raylib examples