{"id":13439521,"url":"https://github.com/tomassedovic/tcod-rs","last_synced_at":"2025-09-05T14:33:44.050Z","repository":{"id":54767984,"uuid":"20941939","full_name":"tomassedovic/tcod-rs","owner":"tomassedovic","description":"Rust bindings for libtcod 1.6.3 (the Doryen library/roguelike toolkit)","archived":false,"fork":false,"pushed_at":"2021-01-30T15:26:36.000Z","size":21085,"stargazers_count":228,"open_issues_count":22,"forks_count":45,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-12-30T14:20:12.381Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"wtfpl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomassedovic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-06-17T22:43:56.000Z","updated_at":"2024-11-17T14:21:10.000Z","dependencies_parsed_at":"2022-08-14T02:10:54.865Z","dependency_job_id":null,"html_url":"https://github.com/tomassedovic/tcod-rs","commit_stats":null,"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomassedovic%2Ftcod-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomassedovic%2Ftcod-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomassedovic%2Ftcod-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomassedovic%2Ftcod-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomassedovic","download_url":"https://codeload.github.com/tomassedovic/tcod-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232044753,"owners_count":18464627,"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":[],"created_at":"2024-07-31T03:01:14.632Z","updated_at":"2025-01-01T03:04:11.437Z","avatar_url":"https://github.com/tomassedovic.png","language":"C","readme":"# Warning: Not Maintained\n\nThis project is no longer actively developed or maintained. Please accept our apologies.\n\nOpen pull requests may still get merged, but we don't expect to investigate or fix open issues.\n\n## Alternatives\n\nThere are two great alternatives to check out! They are both written in pure Rust (fewer chances of library linking or dependency issues, easier to deploy) and target the web browsers as well.\n\n* [bracket-lib](https://github.com/thebracket/bracket-lib)\n  * Written by [Herbert \"TheBracket\"](https://github.com/thebracket), author of [Nox Futura](https://thebracket.itch.io/nox-futura)\n  * Comes with a [comprehensive tutorial](https://bfnightly.bracketproductions.com/rustbook/)\n* [doryen-rs](https://github.com/jice-nospam/doryen-rs)\n  * Written by [Jice](https://github.com/jice-nospam), the original author of libtcod (which this project provides bindings for)\n  * Spiritual successor to libtcod\n\nlibtcod bindings for Rust [![Build Status](https://travis-ci.org/tomassedovic/tcod-rs.svg?branch=master)](https://travis-ci.org/tomassedovic/tcod-rs)\n-------------------------\n\n[libtcod a.k.a. \"The Doryen Library\"](https://github.com/libtcod/libtcod)\nis a smallish library designed for writing roguelikes. It provides a bunch of\nuseful functionality such as:\n\n* Text-based graphics API that doesn't suck as much as Curses or OpenGL\n* Colours! (like, more than 16)\n* Keyboard and mouse input\n* Path finding\n* Field of view\n* Portable (works on linux, windows and mac)\n* [Lots of other stuff](https://bitbucket.org/libtcod/libtcod/wiki/Features)\n\n\nThis project provides [Rust](http://www.rust-lang.org/) bindings for libtcod\nv1.6.3.\n\nThis project follows [Semantic Versioning](http://semver.org/). Since we're\nunder `1.0.0` anything goes. The API can change at any time.\n\nIndeed, it probably should change! If you have better ideas on how it make it\nsafer or more familiar to Rust developers, please let us know.\n\n\nDocumentation\n---------------\n\nWe run `rustdoc` on every new commit:\n\nhttp://tomassedovic.github.io/tcod-rs/tcod/index.html\n\nBut that's mostly useful for types, function signatures, etc. We don't have much\nin term of actual docs, but you can always check the official ones:\n\nhttps://libtcod.readthedocs.io/en/stable/\n\n\nCurrent status\n--------------\n\nAll raw tcod bindings are available via the `tcod-sys` crate. In addition we\nwant to provide safe (and more in line with the Rust style) wrappers -- if you\ncan segfault outside of `unsafe` blocks, that's a bug. The safe bindings are not\nyet complete, however.\n\n### Already Implemented\n\n* _Colors_\n* _Console_\n* Most of the _System_ layer (FPS, time, fullscreen, screenshots)\n* _Field of view_\n* _Map_\n* _Path finding_ (both A\\* and Dijkstra)\n* _Pseudorandom number generator_ (prefer the `rand` crate, except for places where the API requires the built-in generators)\n* _Name generator_\n* _Image toolkit_\n* _Line toolkit_\n* _Noise_\n* _BSP toolkit_\n\n### Probably Won't Ever Be Implemented Because Rust Provides This Already\n* Filesystem utilities\n* Containers\n* Compression toolkit (there will probably be a better Rust library for this)\n\n### Not Implemented Yet But Should Happen At Some Point In The Future\n* Everything else!\n\n\n\nHow to use this\n---------------\n\n`tcod-rs` depends on `libtcod` so you need to build or download the official\nversion. The `libtcod` version known to work is bundled with `tcod-sys` and\nCargo will build it for you, but you need the build dependencies installed.\n\nAlternatively, you can provide the precompiled libtcod library to override the\nbuilding process. [See below](#using-existing-binary-distribution).\n\nTo use `tcod-rs`, add this to your game's `Cargo.toml`:\n\n```toml\n[dependencies]\ntcod = \"0.15\"\n```\n\n### Building on Linux\n\nRun the equivalent of:\n\n```sh\n$ sudo apt-get install gcc g++ make libsdl2-dev\n$ cd yourgame\n$ cargo build --release\n$ cargo run --release\n```\n\non your distro.\n\n#### Building a dynamic library\n\nBy default, `tcod-rs` will build the library statically on Linux as including\nthe code into the executable is usually more convenient. To build a dynamic\nlibrary specify the `dynlib` feature for `tcod-sys` in `Cargo.toml`\n\n```\n[dependencies.tcod-sys]\nversion = \"*\"\nfeatures = [\"dynlib\"]\n```\n\n### Building on Windows (with MSVC)\n\nMake sure you have Visual Studio 2013 or later **with the C++ tools\noption** installed. You also need the \"MSVC ABI\" version of the Rust\ncompiler (as opposed to the \"GNU ABI\" one).\n\nThen, set up the compilation environment, make sure Rust is in your\n`PATH` and run Cargo:\n\n```\nC:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\vcvarsall.bat amd64\nset PATH=%PATH%;C:\\Program Files (x86)\\Rust\\bin\ncd yourgame\ncargo build --release\ncargo run --release\n```\n\n\n### Building on Windows (with MinGW)\n\nYou have to [download and install MinGW](http://www.mingw.org/). Then,\nadd Rust's and MinGW's bin directories to your path and compile your\ngame:\n\n```\nset PATH=%PATH%;C:\\Program Files (x86)\\Rust\\bin;C:\\MinGW\\bin\ncd yourgame\ncargo build --release\ncargo run --release\n```\n\n\n### Building on Mac OS X\n\n1. [Install Homebrew](http://brew.sh/)\n2. Run:\n\n```sh\n$ brew install pkg-config sdl2\n$ cd yourgame\n$ cargo build --release\n$ cargo run --release\n```\n\nThis is based on the instructions from [Jared McFarland's roguelike tutorial](http://jaredonline.svbtle.com/roguelike-tutorial-in-rust-part-1).\n\n---\n\nTo test this, you can clone this repository directly and run the one of the\nprovided examples:\n\n```sh\n$ git clone https://github.com/tomassedovic/tcod-rs.git\n$ cd tcod-rs\n$ cargo run --example keyboard\n```\n\n\n### Using existing binary distribution\n\nIf you don't want to build libtcod yourself, you can\n[instruct Cargo to override the build script](http://doc.crates.io/build-script.html#overriding-build-scripts). See `.cargo/config`\nfrom the repository for an example.\n\nNOTE: The official MinGW pre-built libraries (for Windows)\n[don't seem to work with tcod-rs](https://github.com/tomassedovic/tcod-rs/issues/54).\nWe're not sure exactly why this is so we'd appreciate anyone's help!\n\n\nContributing\n------------\n\nThe raw bindings were generated using\n[rust-bindgen](https://github.com/rust-lang/rust-bindgen) and are located at\n`src/ffi.rs`. The safe (hopefully?) wrapper was built on top of them at\n`src/lib.rs`.\n\nThis is far from done, patches to missing functionality wrappers, documentation\nand examples are very much appreciated. If your patch (any patch -- including\ntypos) gets accepted, you'll get a commit access if you want it.\n\nWe accept GitHub as well as regular pull requests (i.e. emailing or tweeting the\nURL of your feature branch works).\n\nYou can regenerate the raw bindings by running:\n\n```sh\nbindgen -builtins -l tcod include/libtcod.h -o src/ffi.rs\n```\n\n\n### Contributors\n\n\n* Bastien Léonard, @bastienleonard, \u003cbastien.leonard@gmail.com\u003e\n* Darren Kaste, @dkaste, \u003cdarrenkaste@gmail.com\u003e\n* Edu Garcia, @Arcnor, \u003carcnorj@gmail.com\u003e\n* Guillermo Galizzi \u003cgalizzi.guillermo@gmail.com\u003e\n* Gustorn \u003cgustorn@gmail.com\u003e\n* Jared McFarland, @jaredonline, \u003cjared.online@gmail.com\u003e\n* Jonny Gilchrist, @jgilchrist\n* LaylConway \u003claylconway@live.com\u003e\n* Moredread \u003ccode@andre-bubel.de\u003e\n* Nikita Pekin\n* Paul Sanford, @pmsanford, \u003cme@paulsanford.net\u003e\n* Pranz, \u003cjesper.fridefors@gmail.com\u003e\n* Tomas Sedovic, @tomassedovic, \u003ctomas@sedovic.cz\u003e\n* Tomasz Barański, \u003cyubizume@gmail.com\u003e\n\n\n### License\n\n**tcod-rs** is licensed under [WTFPL v2](http://www.wtfpl.net/txt/copying/). See\n`COPYING.txt` for the full text of the license (don't worry -- it's really\nshort and to the point).\n","funding_links":[],"categories":["Libraries","C","库 Libraries","库"],"sub_categories":["Game development","游戏开发 Game development","游戏开发"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomassedovic%2Ftcod-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomassedovic%2Ftcod-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomassedovic%2Ftcod-rs/lists"}