Go bindings for raylib, a simple and easy-to-use library to enjoy videogames programming.
Find a file
Milan Nikolic 041fa24e1f Fix games
2018-05-06 14:42:17 +02:00
easings Golint 2017-02-21 15:26:25 +01:00
examples Fix games 2018-05-06 14:42:17 +02:00
physics Typo 2017-11-19 20:35:01 +01:00
raygui Update C sources, add new functions 2018-05-06 09:34:11 +02:00
raylib Include ALSA headers 2018-05-06 14:26:25 +02:00
raymath Fix translate matrix creation. 2018-03-07 17:43:11 +02:00
rres Move rres 2018-02-21 22:11:07 +01:00
.appveyor.yml OpenAL is no more 2017-12-05 19:45:13 +01:00
.travis.yml Disable OS X build, it is too crowded 2017-12-07 19:56:41 +01:00
LICENSE Initial commit 2017-01-27 09:35:30 +01:00
Makefile rREM - raylib Resource EMbedder 2017-11-27 05:32:39 +01:00
README.md Include ALSA headers 2018-05-06 14:26:25 +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 learn videogames programming.

screenshot

Requirements

  • GLFW is included as part of the Go package, but you need to make sure you have dependencies installed, see below.
Ubuntu
apt-get install libgl1-mesa-dev libxi-dev libxinerama-dev libxcursor-dev libxxf86vm-dev libxrandr-dev
Fedora
dnf install mesa-libGL-devel libXi-devel libXcursor-devel libXrandr-devel libXinerama-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() {
	raylib.InitWindow(800, 450, "raylib [core] example - basic window")

	raylib.SetTargetFPS(60)

	for !raylib.WindowShouldClose() {
		raylib.BeginDrawing()

		raylib.ClearBackground(raylib.RayWhite)

		raylib.DrawText("Congrats! You created your first window!", 190, 200, 20, raylib.LightGray)

		raylib.EndDrawing()
	}

	raylib.CloseWindow()
}

Check more examples organized by raylib modules.

License

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