Difference between revisions of "Wit"

From WiiBrew
Jump to navigation Jump to search
m (moved User:Ahigerd/wit to Wit)
Line 66: Line 66:
 
=== Sound ===
 
=== Sound ===
 
WIT may eventually provide some sort of sound support, but plans in this direction are uncertain.
 
WIT may eventually provide some sort of sound support, but plans in this direction are uncertain.
 +
 +
[[Category:Libraries]][[Category:Framework Libraries]]

Revision as of 02:34, 12 October 2009

WIT
General
Author(s)ahigerd
TypeFramework library
LicenceCPL
Links
Download
Source

WIT, the Wii Interface Toolkit, is an event-driven C++-based development toolkit intended for Wii software development.

The intent of WIT is to encapsulate most of the mundane details of the Wii platform behind a consistent programming interface while remaining relatively lightweight. The Wii Remote and Nunchuk, the Classic Controller, and GameCube controllers are all managed through the same event system, allowing all forms of input to be handled consistently without requiring the developer to write separate code for each controller type. The Guitar Hero 3 and Balance Board accessories are also supported. WIT's design is inclusive, allowing the developer to use native API calls and third-party libraries without restriction or interference.

A secondary goal is to be the most thoroughly documented homebrew library available. Every constant, function, and class exposed by the WIT API is fully documented.

The current implementation of WIT is based on libOGC, but the toolkit API is backend-independent and should be readily portable to the official WiiWare SDK; likewise, a desktop-based Wii simulator using native graphics and input backends (perhaps through wiiuse or simulating the Wii Remote with a mouse) would be possible.

Installing WIT

WIT only has one dependency, libOGC, which is included with devkitPro.

Download the binary package (be sure to get the one for the version of libOGC you have installed) and copy the contents of the include/ and lib/ directories to the usual places in your devkitPro installation.

HTML documentation is included in the binary package, in the doc/html/ directory.

Building WIT

To check out the latest WIT source code, you will need Mercurial, or you can download the latest snapshot from the Downloads page.

Compiling WIT is simply a matter of invoking make.

After WIT is compiled, you may invoke make install to copy the files into your devkitPro installation.

You may also invoke make docs to generate the HTML documentation. Building the documentation requires Doxygen.

Usage

Adding WIT to your application is simply a matter of adding -lwit to the LIBS line of your Makefile. WIT also includes a sample application template in examples/template/, which contains a stub source file and a Makefile suitable for building against the installed version of WIT.

The Widgets example demonstrates many of the things a typical WIT program will do and includes comments explaining how each component fits together. Its source code is available for viewing on Bitbucket.

Other examples of WIT usage are included in the examples/ directory of the source distribution.

License

WIT is provided under the CPL.

In a nutshell, the CPL allows you to release your compiled binary under any license you want as long as you include an offer to receive the source code to the version of WIT used to build it. Unlike the LGPL, this does not include any requirement to enable the recipient to rebuild your program.

Features and Future Development

Controllers

The current (r51) version of WIT has been tested with the buttons and IR sensor on the Wii Remote and with the D-pad on the GameCube controller. In theory, the motion sensors of the Wii Remote and Nunchuk should work, as well as the joysticks, digital buttons, and analog buttons of the Nunchuk, Classic Controller, Guitar Hero 3, and GameCube controller; these have not been tested yet. Support for the Balance Board is pending.

File Systems

WIT will eventually provide support for FAT filesystems via libELM. Developers are free to use libELM or libFAT; code written using these filesystem libraries will continue to work after WIT integrates support.

WIT will also eventually provide support for reading CDs and DVDs via libiso9660; likewise, code written against libiso9660 now will continue to work after WIT integrates support. WIT may also eventually provide support for embedded resources. When support for filesystems is implemented, all filesystems will be accessed through the same API, allowing developers to write code that supports reading from any supported source.

Graphics

WIT currently provides no support for decoding image files or drawing them on the screen. Support for drawing images will eventually be implemented. WIT will not provide built-in support for decoding image files, but developers are free to use libjpeg, libpng, or other libraries for decoding.

Text

WIT currently provides only a simple text console with a number of limitations. (These are the same limitations as the text console offered by libOGC.) Support for variable-width bitmap fonts is upcoming; for efficiency, WIT will have a special file format for these fonts. A tool for converting TrueType fonts to this format may be provided. Code written using FreeTypeGX will continue to work.

Sound

WIT may eventually provide some sort of sound support, but plans in this direction are uncertain.