MCPcopy Index your code
hub / github.com/dradtke/go-allegro

github.com/dradtke/go-allegro @v1.0.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.0.0 ↗ · + Follow
950 symbols 1,258 edges 60 files 514 documented · 54%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

go-allegro

GoDoc

This repository contains bindings for writing Allegro 5 games in Go. Obviously, in order for them to work, you'll need to already have a working Allegro 5 development environment set up.

Function documentation is included in the source, but it's pulled directly from Allegro's C API documentation, so not everything will line up as far as parameters and return values. However, the C API maps pretty well to the Go API, so if you're familiar with the patterns (e.g. error's instead of boolean success values, multiple return values instead of output parameters, object functions as instance methods on structs), then it shouldn't be hard to figure out what's going on.

A number of Allegro functions are blacklisted (via the blacklist file) because they either a) overlap with existing Go functionality, like UTF-8 support, or b) are too low-level and probably shouldn't be implemented in Go anyway, like registering new bitmap loaders. These exceptions aside, the bindings officially have 100% method coverage as of Allegro 5.0.10. You can verify this by running go test coverage_test.go; any methods found in a header file that aren't covered somewhere in the bindings will show up as unit test failures.

Branching

master is the default branch, but you should usually use one corresponding to your Allegro version. Check out the list of branches to see what's available.

Installation

Before installation, be sure to get the source by running go get -d github.com/dradtke/go-allegro.

*Nix

Install Allegro 5 through your favorite package manager, ensure that it's registered with pkg-config, then run go install github.com/dradtke/go-allegro/allegro.

Windows

Download the Allegro 5 binaries here and extract the root folder somewhere.

Set the ALLEGRO_HOME environment variable to this folder's absolute path, and set ALLEGRO_VERSION to the version of Allegro downloaded, e.g. 5.0.10. You can also optionally set ALLEGRO_LIB to reflect which version you want to link against; the default value is monolith-static-mt-debug.

Once that's done, run the included setenv.bat, and if no errors were reported, then you can then build and install the library as usual.

Extension points exported contracts — how you extend this code

AudioStreamFragment (Interface)
* -- Audio Stream Fragment -- */ [2 implementers]
allegro/event.go
AudioStreamFragment (Interface)
* -- Audio Stream Fragment -- */ [2 implementers]
allegro/audio/events.go
EventGenerator (Interface)
This file contains tools for making the library more idiomatic by doing things like grouping common functionality into i [1 …
allegro/gopherize.go
AudioStreamFinished (Interface)
* -- Audio Stream Finished -- */ [2 implementers]
allegro/event.go
AudioStreamFinished (Interface)
* -- Audio Stream Finished -- */ [2 implementers]
allegro/audio/events.go
JoystickAxisEvent (Interface)
* -- Joystick Axis -- */
allegro/event.go
JoystickButtonDownEvent (Interface)
* -- Joystick Button Down -- */
allegro/event.go
JoystickButtonUpEvent (Interface)
* -- Joystick Button Up -- */
allegro/event.go

Core symbols most depended-on inside this repo

freeString
called by 23
allegro/memory.go
col
called by 17
allegro/primitives/primitives.go
Attr
called by 8
documenter.go
Error
called by 8
allegro/state.go
SetTargetBitmap
called by 7
allegro/graphics.go
Find
called by 6
documenter.go
cast
called by 5
allegro/event.go
Destroy
called by 5
allegro/timer.go

Shape

Method 573
Function 238
TypeAlias 92
Interface 28
Struct 19

Languages

Go100%
C1%

Modules by API surface

allegro/event.go338 symbols
allegro/graphics.go89 symbols
allegro/display.go44 symbols
allegro/audio/sample.go42 symbols
allegro/primitives/primitives.go37 symbols
allegro/audio/stream.go33 symbols
allegro/mouse.go29 symbols
allegro/config.go26 symbols
allegro/joystick.go23 symbols
allegro/dialog/dialog.go21 symbols
allegro/audio/mixer.go21 symbols
allegro/file.go20 symbols

For agents

$ claude mcp add go-allegro \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page