Go bindings for raylib, a simple and easy-to-use library to enjoy videogames programming.
Find a file
2021-02-24 13:49:34 -08:00
easings Update C sources, add new functions and rename package to 2018-10-08 18:56:34 +02:00
examples Fix Android 2020-09-03 23:22:07 +02:00
physics Move raymath to raylib package, issue #58 2020-09-05 17:38:24 +02:00
raygui ToggleGroup cleanup [minor] 2021-02-24 13:49:34 -08:00
raylib fix binding mistakes 2021-02-06 01:34:23 +01:00
rres Update C sources, add new functions and rename package to 2018-10-08 18:56:34 +02:00
.appveyor.yml OpenAL is no more 2017-12-05 19:45:13 +01:00
.gitignore Add gitignore, ignore .idea 2020-04-11 12:59:02 +02:00
.travis.yml Travis add GL library 2019-09-22 19:17:46 +02:00
LICENSE Initial commit 2017-01-27 09:35:30 +01:00
Makefile Move raymath to raylib package, issue #58 2020-09-05 17:38:24 +02:00
README.md Update README.md 2020-05-04 18:50:00 +02:00

logo

raylib-go

TravisCI Build Status AppVeyor Build status GoDoc Go Report Card Examples

Golang bindings for raylib, a simple and easy-to-use library to enjoy videogames programming.

Requirements

Ubuntu
X11
apt-get install libgl1-mesa-dev libxi-dev libxcursor-dev libxrandr-dev libxinerama-dev 
Wayland
apt-get install libgl1-mesa-dev libwayland-dev libxkbcommon-dev 
Fedora
X11
dnf install mesa-libGL-devel libXi-devel libXcursor-devel libXrandr-devel libXinerama-devel
Wayland
dnf install mesa-libGL-devel wayland-devel libxkbcommon-devel
macOS

On macOS you need Xcode or Command Line Tools for Xcode.

Windows

On Windows you need C compiler, like Mingw-w64 or TDM-GCC. You can also build binary in MSYS2 shell.

Android

Android example.

Raspberry Pi

RPi example.

Installation

go get -v -u github.com/gen2brain/raylib-go/raylib

Build tags

  • noaudio - disables audio functions
  • opengl21 - 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

Documentation on GoDoc. Also check raylib cheatsheet.

Example

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.

License

raylib-go is licensed under an unmodified zlib/libpng license. View LICENSE.