raylib-go

module
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 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 enjoy videogames programming.

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/MattSwanson/raylib-go/raylib

Build tags

  • drm - build for Linux native mode, including Raspberry Pi 4 and other devices (PLATFORM_DRM)
  • rpi - build for Raspberry Pi platform (PLATFORM_RPI)
  • wayland - build against Wayland libraries
  • 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)

Documentation

Documentation on GoDoc. Also check raylib cheatsheet.

Example

package main

import "github.com/MattSwanson/raylib-go/raylib"

func main() {
	rl.InitWindow(800, 450, "raylib [core] example - basic window")

	rl.SetTargetFPS(60)

	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.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
GUI element appearance can be dynamically configured through Property values, the set of which forms a theme called the Style.
GUI element appearance can be dynamically configured through Property values, the set of which forms a theme called the Style.
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.
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