-
Notifications
You must be signed in to change notification settings - Fork 8
/
README
73 lines (57 loc) · 2.85 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
What is it
----------
libtcod-go is a set of Go bindings for the libtcod library
libtcod (http://roguecentral.org/doryen/libtcod/) is an open-source, cross-platform C
library for writing roguelike games
It provides many utilities frequently used in roguelike games, like
- truecolor console (SDL and OpenGL backends)
- keyboard/mouse input
- misc algorithms (line drawing, pathfinding, field of view, dungeon generation)
- terrain and noise generators
- widget toolkit
- config parser
- name generator
etc.
Go (http://golang.org/) is a programming language released in 2009 by Google.
It is a static language with dynamic feel, compiles to native code, has clean syntax (somewhat
between C and Python) with garbage collection and language support for unicode
and concurrency.
Most of libtcod API (version 1.5.1) is wrapped in Go, with some parts fully ported to enable easier
callbacks. In addition, the demo and terrain-generation tool were also fully ported to
serve as examples on how to use the library.
Installation
------------
To build the bindings, you will need the libtcod library and Go language installed.
Please refer to http://golang.org/doc/install.html for Go installation
and to http://doryen.eptalys.net/libtcod/download/ for libtcod installation.
You can obtain libtcod-go by running `go get github.com/afolmert/libtcod-go/tcod`,
and use the library in your programs with `import "github.com/afolmert/libtcod-go/tcod"`.
The sample program and hmtool program can be built by running `go build` from
within their respective directories, and then running the `./sample` and `./hmtool`
binaries respectively. This is preferred to using `go get` or `go install` to
install these binaries because they use data and images from their source directory
and `go install` has no way to install these.
Documentation
--------------
Although there is no documentation for the bindings themselves, the bindings API
does not differ much from the original library, so the original documentation should
be very helpful (http://doryen.eptalys.net/data/libtcod/doc/1.5.1/index2.html?c=true).
The samples and hmtool program also use many parts of the API so they also could be
helpful to get started.
Bugs
-----
Original API parts missing from Go bindings:
- custom containers (TCOD_list_t) - alternatives exist in Go
- thread/mutexes functions - alternatives exist in Go
- SDL callback renderer - callbacks from C are currently cumbersome in Go
The bindings have been tested on 32bit and 64bit Linux with 8g and 6g compilers.
There may still be some issues on other platforms.
Please report any problems and other bugs to afolmert (at) gmail (dot) com
Credits
--------
Thanks to:
Go Authors for the Go language
Jice, Mingos and others for the libtcod library
Chris Hamons for API design ideas in the libtcod-net bindings
Felipe Bichued for comments and ideas
Alex Ogier for patches updating to Go 1.2