raylib-go

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

Github星跟踪图

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.

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

	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.

主要指标

概览
名称与所有者gen2brain/raylib-go
主编程语言C
编程语言Go (语言数: 2)
平台
许可证zlib License
所有者活动
创建于2017-01-27 16:31:45
推送于2025-09-25 23:48:16
最后一次提交2025-09-25 23:48:13
发布数14
最新版本名称raylib/v0.56.0-dev (发布于 2025-08-07 21:56:17)
第一版名称1.9.4-dev (发布于 2018-05-07 12:08:53)
用户参与
星数2.2k
关注者数18
派生数189
提交数1.1k
已启用问题?
问题数286
打开的问题数6
拉请求数182
打开的拉请求数2
关闭的拉请求数32
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?