raylib-go

module
v0.0.0-...-6f808ed Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2017 License: Zlib

README

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

Build tags

  • noaudio - disables audio functions and doesn't link against OpenAL libraries
  • 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
  • static - links against OpenAL static 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.

Directories

Path Synopsis
Package easings - Useful easing functions for values animation
Package easings - Useful easing functions for values animation
examples
Package physics - 2D Physics library for videogames
Package physics - 2D Physics library for videogames
Package raygui - Simple and easy-to-use IMGUI (immediate mode GUI API) library
Package raygui - Simple and easy-to-use IMGUI (immediate mode GUI API) library
Package raylib - Go bindings for raylib, a simple and easy-to-use library to learn videogames programming.
Package raylib - Go bindings for raylib, a simple and easy-to-use library to learn videogames programming.
Package raymath - Some useful functions to work with Vector2, Vector3, Matrix and Quaternions
Package raymath - Some useful functions to work with Vector2, Vector3, Matrix and Quaternions
cmd/rrem
rREM - raylib Resource EMbedder
rREM - raylib Resource EMbedder

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL