{"id":13366469,"url":"https://github.com/gen2brain/raylib-Go","last_synced_at":"2025-03-12T18:31:12.087Z","repository":{"id":38965674,"uuid":"80191982","full_name":"gen2brain/raylib-go","owner":"gen2brain","description":"Go bindings for raylib, a simple and easy-to-use library to enjoy videogames programming.","archived":false,"fork":false,"pushed_at":"2024-05-22T15:12:57.000Z","size":34369,"stargazers_count":1342,"open_issues_count":3,"forks_count":147,"subscribers_count":17,"default_branch":"master","last_synced_at":"2024-05-22T15:48:37.991Z","etag":null,"topics":["android","game-engine","golang","raylib","rpi","video-game"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"zlib","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gen2brain.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-27T08:31:45.000Z","updated_at":"2024-06-18T12:26:11.532Z","dependencies_parsed_at":"2023-10-16T19:43:28.041Z","dependency_job_id":"a8110ce4-0470-4776-bbf2-751d5bba1500","html_url":"https://github.com/gen2brain/raylib-go","commit_stats":{"total_commits":497,"total_committers":35,"mean_commits":14.2,"dds":0.3440643863179075,"last_synced_commit":"0fdd3be3077b1996f2004a38d7548db0b966831c"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gen2brain%2Fraylib-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gen2brain%2Fraylib-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gen2brain%2Fraylib-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gen2brain%2Fraylib-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gen2brain","download_url":"https://codeload.github.com/gen2brain/raylib-go/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221309822,"owners_count":16795817,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","game-engine","golang","raylib","rpi","video-game"],"created_at":"2024-07-30T00:01:25.248Z","updated_at":"2025-03-12T18:31:12.056Z","avatar_url":"https://github.com/gen2brain.png","language":"C","readme":"![logo](https://goo.gl/XlIcXz)\n## raylib-go\n[![Build Status](https://github.com/gen2brain/raylib-go/actions/workflows/build.yml/badge.svg)](https://github.com/gen2brain/raylib-go/actions)\n[![GoDoc](https://godoc.org/github.com/gen2brain/raylib-go/raylib?status.svg)](https://godoc.org/github.com/gen2brain/raylib-go/raylib)\n[![Go Report Card](https://goreportcard.com/badge/github.com/gen2brain/raylib-go/raylib)](https://goreportcard.com/report/github.com/gen2brain/raylib-go/raylib)\n[![Examples](https://img.shields.io/badge/learn%20by-examples-0077b3.svg?style=flat-square)](https://github.com/gen2brain/raylib-go/tree/master/examples)\n\nGolang bindings for [raylib](http://www.raylib.com/), a simple and easy-to-use library to enjoy videogames programming.\n\nraylib C source code is included and compiled together with bindings. Note that the first build can take a few minutes.\n\nIt is also possible to use raylib-go without cgo (Windows only; see requirements below).\n\n### Requirements\n\n##### Ubuntu\n\n    apt-get install libgl1-mesa-dev libxi-dev libxcursor-dev libxrandr-dev libxinerama-dev libwayland-dev libxkbcommon-dev\n\n##### Fedora\n\n    dnf install mesa-libGL-devel libXi-devel libXcursor-devel libXrandr-devel libXinerama-devel wayland-devel libxkbcommon-devel\n\n##### macOS\n\nOn macOS, you need Xcode or Command Line Tools for Xcode (if you have `brew` installed, you already have this).\n\n##### Windows\n\n###### cgo\n\nOn Windows you need C compiler, like [Mingw-w64](https://mingw-w64.org) or [TDM-GCC](http://tdm-gcc.tdragon.net/).\nYou can also build binary in [MSYS2](https://msys2.github.io/) shell.\n\nTo remove console window, build with `-ldflags \"-H=windowsgui\"`.\n\n###### purego (without cgo, i.e. CGO_ENABLED=0)\n\nDownload the raylib.dll from the assets on the [releases page](https://github.com/raysan5/raylib/releases). It is contained in the `raylib-*_win64_msvc*.zip`.\nPut the raylib.dll into the root folder of your project or copy it into `C:\\Windows\\System32` for a system-wide installation.\n\nIt is also possible to build the DLL yourself. You can find more info at [raylib's wiki](https://github.com/raysan5/raylib/wiki/Working-on-Windows).\n\n##### Android\n\n[Android example](https://github.com/gen2brain/raylib-go/tree/master/examples/others/android/example).\n\n### Installation\n\n    go get -v -u github.com/gen2brain/raylib-go/raylib\n\n### Build tags\n\n* `drm` - build for Linux native [DRM](https://en.wikipedia.org/wiki/Direct_Rendering_Manager) mode, including Raspberry Pi 4 and other devices (PLATFORM_DRM)\n* `sdl` - build for [SDL](https://github.com/libsdl-org/SDL) backend (PLATFORM_DESKTOP_SDL)\n* `sdl3` - build for [SDL3](https://github.com/libsdl-org/SDL) backend (PLATFORM_DESKTOP_SDL3)\n* `rgfw` - build for [RGFW](https://github.com/ColleagueRiley/RGFW) backend (PLATFORM_DESKTOP_RGFW)\n* `noaudio` - disables audio functions\n* `opengl43` - uses OpenGL 4.3 backend\n* `opengl21` - uses OpenGL 2.1 backend (default is 3.3 on desktop)\n* `opengl11` - uses OpenGL 1.1 backend (pseudo OpenGL 1.1 style)\n* `es2` - uses OpenGL ES 2.0 backend (can be used to link against [Google's ANGLE](https://github.com/google/angle))\n* `es3` - experimental support for OpenGL ES 3.0\n* `x11` - force X11 compatibility mode on Wayland (PLATFORM_DESKTOP/GLFW)\n* `wayland` - force Wayland only mode (PLATFORM_DESKTOP/GLFW)\n\n### Documentation\n\nDocumentation on [GoDoc](https://godoc.org/github.com/gen2brain/raylib-go/raylib). Also check raylib [cheatsheet](http://www.raylib.com/cheatsheet/cheatsheet.html). If you have problems or need assistance there is an active community in the #raylib-go channel of the [Raylib Discord Server](https://discord.gg/raylib) that can help.\n\n### Example\n\n```go\npackage main\n\nimport rl \"github.com/gen2brain/raylib-go/raylib\"\n\nfunc main() {\n\trl.InitWindow(800, 450, \"raylib [core] example - basic window\")\n\tdefer rl.CloseWindow()\n\n\trl.SetTargetFPS(60)\n\n\tfor !rl.WindowShouldClose() {\n\t\trl.BeginDrawing()\n\n\t\trl.ClearBackground(rl.RayWhite)\n\t\trl.DrawText(\"Congrats! You created your first window!\", 190, 200, 20, rl.LightGray)\n\n\t\trl.EndDrawing()\n\t}\n}\n```\n\nCheck more [examples](https://github.com/gen2brain/raylib-go/tree/master/examples) organized by raylib modules.\n\n### Cross-compile (Linux)\n\nTo cross-compile for Windows install [MinGW](https://www.mingw-w64.org/) toolchain.\n\n```\n$ CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc GOOS=windows GOARCH=amd64 go build -ldflags \"-s -w\"\n$ file basic_window.exe\nbasic_window.exe: PE32+ executable (console) x86-64 (stripped to external PDB), for MS Windows, 11 sections\n\n$ CGO_ENABLED=1 CC=i686-w64-mingw32-gcc GOOS=windows GOARCH=386 go build -ldflags \"-s -w\"\n$ file basic_window.exe\nbasic_window.exe: PE32 executable (console) Intel 80386 (stripped to external PDB), for MS Windows, 9 sections\n```\n\nTo cross-compile for macOS install [OSXCross](https://github.com/tpoechtrager/osxcross) toolchain.\n\n```\n$ CGO_ENABLED=1 CC=x86_64-apple-darwin21.1-clang GOOS=darwin GOARCH=amd64 go build -ldflags \"-linkmode external -s -w '-extldflags=-mmacosx-version-min=10.15'\"\n$ file basic_window\nbasic_window: Mach-O 64-bit x86_64 executable, flags:\u003cNOUNDEFS|DYLDLINK|TWOLEVEL\u003e\n\n$ CGO_ENABLED=1 CC=aarch64-apple-darwin21.1-clang GOOS=darwin GOARCH=arm64 go build -ldflags \"-linkmode external -s -w '-extldflags=-mmacosx-version-min=12.0.0'\"\n$ file basic_window\nbasic_window: Mach-O 64-bit arm64 executable, flags:\u003cNOUNDEFS|DYLDLINK|TWOLEVEL|PIE\u003e\n```\n\n### License\n\nraylib-go is licensed under an unmodified zlib/libpng license. View [LICENSE](https://github.com/gen2brain/raylib-go/blob/master/LICENSE).\n","funding_links":[],"categories":["游戏开发","遊戲開發"],"sub_categories":["高级控制台界面","高級控制台界面"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgen2brain%2Fraylib-Go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgen2brain%2Fraylib-Go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgen2brain%2Fraylib-Go/lists"}