Skip to main content

A Python cffi port of libtcod-1.5.1

Project description

About

This is a Python CFFI port of libtcod, this is an offshoot of the python-tdl project and has been made into it’s own package. Both projects are still developed together, and this module provides functions specifically to be used by python-tdl.

This library is hosted on GitHub: https://github.com/HexDecimal/libtcod-cffi

Any issues you have with this module can be reported at the GitHub issue tracker: https://github.com/HexDecimal/libtcod-cffi/issues

python-tdl is a port of libtcod made to be “Pythonic”, you can find it here: https://github.com/HexDecimal/python-tdl

And libtcod is here: http://roguecentral.org/doryen/libtcod/

Installation (Windows, Mac OS X)

The recommended way to install is by using pip, make sure pip is up-to-date, otherwise it won’t find the wheel and will attempt to build from source.

With Python installed, run the following commands to install libtcod-cffi:

python -m pip install --upgrade pip
python -m pip install libtcod-cffi

Installation (Linux)

There are no libtcod-cffi wheels for Linux, you can still use pip to install libtcod-cffi but will need to have the proper build enviroment set up first.

Install the needed dev packages, update the cffi module, then install via pip. Assuming you are using a debian like distribution you can use the following commands to do this:

apt-get install libsdl1.2 libsdl1.2-dev libffi-dev python-dev mesa-common-dev
python -m pip install --upgrade cffi<2 cffi>=1.1
python -m pip install libtcod-cffi

The Python cffi module must be 1.1 or later, otherwise you will recieve the following error: “ImportError: No module named ‘cffi.setuptools_ext’”

Usage

This module was designed to be backwards compatible with the libtcod.py script that was distributed with libtcod. If you had code that runs on the original module you can use this library as a drop-in replacement like this:

import tcod as libtcod

Guides and Tutorials for the original library should also work with this one. When possible, using PyPy will give the best performance, and is highly recommended.

Requirements

  • Python 2.7+, Python 3.3+, or PyPy

  • Windows, Linux, or Mac OS X

  • Running on Linux requires the following packages: libsdl1.2

  • Installing on Linux or form source will require the following packages: python-cffi 1.1+

  • An up-to-date version of python-cffi: https://pypi.python.org/pypi/cffi

  • Linux will require the package libsdl1.2 to run, and the packages libsdl1.2-dev, libffi-dev, python-dev, and mesa-common-dev to install

License

libtcod-cffi is distributed under the Simplified 2-clause FreeBSD license. Read LICENSE.txt, and the tcod/lib/README’s for more details.

Changelog

0.2.11
  • SDL is now bundled correctly in all Python wheels

0.2.10
  • now using GitHub integrations, gaps in platform support have been filled, there should now be wheels for Mac OSX and 64-bit Python on Windows

  • the building process was simplified from a linking standpoint, most libraries are now statically linked

  • parser module is broken again

0.2.9
  • Fixed crashes in list and parser modules

0.2.8
  • Fixed off by one error in fov buffer

0.2.7
  • Re-factored some code to reduce compiler warnings

  • Instructions on how to solve pip/cffi issues added to the readme

  • Official support for Python 3.5

0.2.6
  • Added requirements.txt to fix a common pip/cffi issue.

  • Provided SDL headers are now for Windows only.

0.2.5
  • Added /usr/include/SDL to include path

0.2.4
  • Compiler will now use distribution specific SDL header files before falling back on the included header files.

0.2.3
  • better Color performance

  • parser now works when using a custom listener class

  • SDL renderer callback now receives a accessible SDL_Surface cdata object.

0.2.2
  • This module can now compile and link properly on Linux

0.2.1
  • console_check_for_keypress and console_wait_for_keypress will work now

  • console_fill_foreground was fixed

  • console_init_root can now accept a regular string on Python 3

0.2.0
  • The library is now backwards compatible with the original libtcod.py module. Everything except libtcod’s cfg parser is supported.

0.1.0
  • First version released

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

libtcod-cffi-0.2.10.tar.gz (1.8 MB view hashes)

Uploaded Source

Built Distributions

libtcod_cffi-0.2.10-py3.5-win-amd64.egg (474.6 kB view hashes)

Uploaded Source

libtcod_cffi-0.2.10-py3.5-win32.egg (414.4 kB view hashes)

Uploaded Source

libtcod_cffi-0.2.10-py3.4-win-amd64.egg (459.2 kB view hashes)

Uploaded Source

libtcod_cffi-0.2.10-py3.4-win32.egg (404.3 kB view hashes)

Uploaded Source

libtcod_cffi-0.2.10-py3.3-win-amd64.egg (459.9 kB view hashes)

Uploaded Source

libtcod_cffi-0.2.10-py3.3-win32.egg (405.0 kB view hashes)

Uploaded Source

libtcod_cffi-0.2.10-py2.7-win-amd64.egg (457.6 kB view hashes)

Uploaded Source

libtcod_cffi-0.2.10-py2.7-win32.egg (397.5 kB view hashes)

Uploaded Source

libtcod_cffi-0.2.10-pp254-pypy_41-win32.whl (341.3 kB view hashes)

Uploaded PyPy Windows x86

libtcod_cffi-0.2.10-pp253-pypy_41-win32.whl (341.3 kB view hashes)

Uploaded PyPy Windows x86

libtcod_cffi-0.2.10-pp251-pypy_41-win32.whl (341.3 kB view hashes)

Uploaded PyPy Windows x86

libtcod_cffi-0.2.10-pp250-pypy_41-win32.whl (341.3 kB view hashes)

Uploaded PyPy Windows x86

libtcod_cffi-0.2.10-pp240-pp240-win32.whl (341.2 kB view hashes)

Uploaded PyPy Windows x86

libtcod_cffi-0.2.10-pp226-pp226-win32.whl (341.2 kB view hashes)

Uploaded PyPy Windows x86

libtcod_cffi-0.2.10-cp35-cp35m-win_amd64.whl (445.3 kB view hashes)

Uploaded CPython 3.5m Windows x86-64

libtcod_cffi-0.2.10-cp35-cp35m-win32.whl (385.2 kB view hashes)

Uploaded CPython 3.5m Windows x86

libtcod_cffi-0.2.10-cp34-cp34m-win_amd64.whl (430.0 kB view hashes)

Uploaded CPython 3.4m Windows x86-64

libtcod_cffi-0.2.10-cp34-cp34m-win32.whl (375.1 kB view hashes)

Uploaded CPython 3.4m Windows x86

libtcod_cffi-0.2.10-cp34-cp34m-macosx_10_9_x86_64.whl (789.7 kB view hashes)

Uploaded CPython 3.4m macOS 10.9+ x86-64

libtcod_cffi-0.2.10-cp33-cp33m-win_amd64.whl (430.0 kB view hashes)

Uploaded CPython 3.3m Windows x86-64

libtcod_cffi-0.2.10-cp33-cp33m-win32.whl (375.1 kB view hashes)

Uploaded CPython 3.3m Windows x86

libtcod_cffi-0.2.10-cp27-cp27m-win_amd64.whl (430.6 kB view hashes)

Uploaded CPython 2.7m Windows x86-64

libtcod_cffi-0.2.10-cp27-cp27m-win32.whl (370.6 kB view hashes)

Uploaded CPython 2.7m Windows x86

libtcod_cffi-0.2.10-cp27-cp27m-macosx_10_9_intel.whl (1.0 MB view hashes)

Uploaded CPython 2.7m macOS 10.9+ intel

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page