Go bindings for raylib, a simple and easy-to-use library to enjoy videogames programming.
Find a file
2017-11-14 13:42:10 +01:00
easings Golint 2017-02-21 15:26:25 +01:00
examples Update example 2017-11-14 13:42:10 +01:00
physics Physics - WIP 2017-05-02 21:49:12 +02:00
raygui Update GUI 2017-10-27 20:01:32 +02:00
raylib Fix shaders 2017-11-14 13:24:06 +01:00
raymath Rename Vector*() functions to Vector3*() 2017-10-26 19:01:14 +02:00
.appveyor.yml Update .appveyor.yml 2017-10-28 16:25:32 +02:00
.travis.yml Update Ubuntu dependencies 2017-10-26 19:10:11 +02:00
LICENSE Initial commit 2017-01-27 09:35:30 +01:00
Makefile Travis add X libraries 2017-01-31 20:51:01 +01:00
README.md Add examples badge 2017-11-14 04:51:08 +01: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

  • OpenAL Soft NOTE: if you don't need audio you can use -tags noaudio during build, OpenAL will not be linked to binary, though none of the audio functions will be available.

  • 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 libopenal-dev libgl1-mesa-dev libxi-dev libxinerama-dev libxcursor-dev libxxf86vm-dev libxrandr-dev
Fedora
dnf install openal-soft-devel mesa-libGL-devel libXi-devel libXcursor-devel libXrandr-devel libXinerama-devel
OS X

On OS X system OpenAL framework is used, you need Xcode or Command Line Tools for Xcode.

Windows (MSYS2)
pacman -S mingw-w64-x86_64-openal mingw-w64-x86_64-gcc mingw-w64-x86_64-go git

On Windows, build binary in MSYS2 shell.

Android

Android example.

Raspberry Pi

RPi example.

Installation

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

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.