Skip to content

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

License

Notifications You must be signed in to change notification settings

zpl-zak/raylib-go

 
 

Repository files navigation

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

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")

	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.PollInputEvents()
	}

	rl.CloseWindow()
}

Check more examples organized by raylib modules.

License

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 77.8%
  • Go 21.8%
  • Other 0.4%