Jotaf has just worked his magic on the python wrapper. It now contains a ConsoleBuffer class that you can use in replacement of the standard console_put_char, console_set_char, … functions.

The trick is that this ConsoleBuffer class sends the whole console at once to libtcod, saving the cost of a lot of ctypes function calls.

The result ? When using ConsoleBuffer, the python color sample has fps equivalent to the C++ sample !

If your python game is a bit laggy, jump on it. It’s on the last bitbucket version.


PS : if you really try to squeeze the last millisecond from python, be aware that the color sample is much faster with python 2.6 than 2.7.


4 comments so far

Add Your Comment
  1. Awesome! is that already documented?

  2. nope. but you have the sample and the source code in libtcodpy.py. It’s pretty intuitive and doesn’t really need extensive documentation…

  3. I’ll write something and put it up as a sticky post in the python forum 🙂

  4. Thanks, both of you! 🙂