raylib-go/README.md
2017-02-01 01:55:34 +01:00

2.2 KiB

raylib-go Build Status GoDoc Go Report Card

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

screenshot

Requirements

  • GLFW3 (desktop platform only, not needed on Android and RPi)
  • OpenAL Soft (on OS X system framework is used)

GLFW version 3.2 is required.

Ubuntu
apt-get install libglfw3-dev libopenal-dev libxi-dev libxinerama-dev libxcursor-dev libxxf86vm-dev

On older Ubuntu releases you will need to compile GLFW, instructions are in travis file.

Fedora
dnf install glfw-devel openal-soft-devel mesa-libGL-devel libXi-devel
OS X
brew install glfw3
Windows (MSYS2)
pacman -S mingw-w64-x86_64-openal mingw-w64-x86_64-glfw mingw-w64-x86_64-gcc mingw-w64-x86_64-go git 
Android

Android example.

Installation

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

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.