GUI library evaluation

From Post-Apocalyptic RPG wiki

Jump to: navigation, search

Spike.png This article covers a spike!

Spikes are timeboxed user stories to reduce risk by creating knowledge. Spikes are a good way to scout potential problems before moving into a sprint. For details see: How to work with spikes


This document presents the results of various research efforts regarding switching from PyChan to a third-party GUI library.

Contents

Spike goal

Evaluate various third-party GUI libraries for replacing PyChan, PARPG's current GUI library provided natively by FIFE.

Evaluation criteria includes (in no particular order):

  • Number and type of widgets supplied;
  • Support for dynamic manipulation of images, especially scaling;
  • Ease of integrating the GUI library into FIFE;
  • Cross-platform support, including Windows, Mac OS, and Linux;
  • Whether it provides stable Python bindings;
  • Whether user-friendly graphical GUI design/layout programs exist;
  • What kind of scripting language it uses, if any;

Spike timeframe

Fixme.png Please help FIXME: To be determined.

Spike team

Currently just Technomage.

Impediments

Fixme.png Please help FIXME: To be determined.

End result

CEGUI

Number and type of widgets

CEGUI comes with a large library of widgets. It is comparable in size to Qt and WxWidgets.

Fixme.png Please help FIXME!

Support for dynamic image manipulation

CEGUI appears to provide extensive image manipulation functionality.

Fixme.png Please help FIXME!

Ease of integration into FIFE

CEGUI is based upon a modular rendering framework provided by render backend modules, much like FIFE. CEGUI provides a render backend module for OpenGL that works out of the box, and requires only two function calls to setup and render the GUI provided an OpenGL context is already established. FIFE's OpenGL render backend module already takes care of setting up the OpenGL rendering context via SDL, and would require little, if any, modification to work with CEGUI. However, FIFE using double-buffered rendering and CEGUI's rendering function needs to be called before swapping the color buffers. Unfortunately FIFE does not provide a means of injecting custom rendering code in between frame setup and swapping of the color buffers, which means that FIFE would have to be patched to support CEGUI. Luckily such a patch would be fairly trivial - just insert a callback function into the OpenGL rendering backend code and provide a means of registering callback functions with the fife.Engine class.

Unfortunately CEGUI does not support SDL software rendering out of the box. Because of its modular architecture it would not be prohibitively difficult to write our own SDL software render backend for CEGUI (indeed, it appears as though several attempts to write an SDL backend for CEGUI have already been made by CEGUI users. It is unknown whether these attempts were successful.)

For input processing, CEGUI uses a flexible event injection system that should be easy to integrate into FIFE. All that would be required is to write a custom event listener class that translates and forwards all input events to CEGUI.

Python bindings

CEGUI's latest release, version 0.7.5, introduced official, stable Python bindings generated via Boost.Python. Initial testing of the Python bindings indicates that the bindings work as advertised on Linux, though further testing is needed.

CEGUI's use of Boost.Python to generate its Python bindings is somewhat problematic, as Boost.Python is notoriously slow at compiling Python bindings (it took 30 minutes to compile CEGUI on my machine, the bulk of which was taken up by the Python bindings. By contrast, it takes FIFE about 15 minutes to compile on the same machine.) In the past Boost.Python was plagued by build issues (both in generating Python bindings and compiling Boost.Python itself), but the latest version of Boost.Python (v1.45.0) compiled and ran without issue on my machine.

Cross-platform support

CEGUI officially supports Windows, Mac OS and Linux.

However, as stated in the 0.7.5 release notes Mac OS X support for the Python bindings is not 100% stable and this will not be addressed until a later release (version 0.8.0 is expected soon, though it is unclear if fixing the Mac OS X instabilities in the Python bindings is a priority for that release).

Graphical layout/design programs

CEGUI provides official graphical layout and skinning programs which automatically generate XML scripts.

Fixme.png Please help FIXME!

Scripting

CEGUI uses a flexible XML-based scripting language that is similar to PyChan's XML scripting. Layout and skinning are scripted separately in CEGUI, and both LUA and Python scripting modules are provided for programming widget logic.

Personal tools