raylib-go

module
Version: v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2019 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

Why does this repo exist?

Why use this version of raylib instead of gen2brain/raylib-go?

Well there are many drawbacks to using this version. The main point of using this version though is if you're using raylib for 3D game development.

If you're using gen2brain currently on v2.1. Models and textures don't work properly.

This repository is just a clone of the v2.0 version for the raylib-go repository since it's not versioned to Go standards.

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/hecate-tech/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/hecate-tech/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 A port of Robert Penner's easing equations (http://robertpenner.com/easing/)
Package easings - Useful easing functions for values animation A port of Robert Penner's easing equations (http://robertpenner.com/easing/)
examples
Package physics - 2D Physics library for videogames A port of Victor Fisac's physac engine (https://github.com/raysan5/raylib/blob/master/src/physac.h)
Package physics - 2D Physics library for videogames A port of Victor Fisac's physac engine (https://github.com/raysan5/raylib/blob/master/src/physac.h)
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 rl - Go bindings for raylib, a simple and easy-to-use library to learn videogames programming.
package rl - 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
t or T : Toggle theme light dark auto
y or Y : Canonical URL