Golang bindings for raylib, a simple and easy-to-use library to enjoy videogames programming.
apt-get install libgl1-mesa-dev libxi-dev libxcursor-dev libxrandr-dev libxinerama-dev
apt-get install libgl1-mesa-dev libwayland-dev libxkbcommon-dev
dnf install mesa-libGL-devel libXi-devel libXcursor-devel libXrandr-devel libXinerama-devel
dnf install mesa-libGL-devel wayland-devel libxkbcommon-devel
On macOS you need Xcode or Command Line Tools for Xcode.
On Windows you need C compiler, like Mingw-w64 or TDM-GCC. You can also build binary in MSYS2 shell.
go get -v -u github.com/gen2brain/raylib-go/raylib
noaudio
- disables audio functionsopengl21
- uses OpenGL 2.1 backend (default is 3.3 on desktop)opengl11
- uses OpenGL 1.1 backend (pseudo OpenGL 1.1 style)wayland
- builds against Wayland libraries
Documentation on GoDoc. Also check raylib cheatsheet.
package main
import "github.com/gen2brain/raylib-go/raylib"
func main() {
rl.InitWindow(800, 450, "raylib [core] example - basic window")
rl.SetTargetFPS(60)
for !rl.WindowShouldClose() {
rl.BeginDrawing()
rl.ClearBackground(rl.RayWhite)
rl.DrawText("Congrats! You created your first window!", 190, 200, 20, rl.LightGray)
rl.EndDrawing()
}
rl.CloseWindow()
}
Check more examples organized by raylib modules.
raylib-go is licensed under an unmodified zlib/libpng license. View LICENSE.