libmenuthing v0.0.1 readme file

libmenuthing is an attempt at making it easier to implement a trivial, usually
unimportant (in looks) part of software as quickly and simply as possible.

There is a precomputed demo and library for GP2X ARM in /arm/demo and
/arm/libmenuthing.a respectively. Makefiles for x86 and ARM platforms are in
the platform root directories of the archive.

-------------------
Installation
-------------------
Installing is easy under Linux (and most UNIX platforms), assuming you have
a similar setup. x86 goes by standard Linux file placement guidelines,
whilst ARM is more specific to my system. In the event that you need to change
where things install, open up the correct Makefile and edit the commented paths
and commands.

Then, simply run:
cd arm/
make
sudo make install

and optionally, you can compile the demo (already compiled) by invoking
make arm-demo.

In the above examples, replace all instances of arm with x86 to achieve the
same result with the supplied x86 source files.

libmenuthing is written and compiled with devkitgp2x.

Note: You will need to include -lSDL and -lSDL_ttf flags to things compiled
with libmenuthing.
Note: To compile the demo, the Makefile assumes libmenuthing has been compiled
and installed to the directories specified at the top.

-------------------
Usage
-------------------
Using the library requires very little knowledge of C++ lists. If you're best
learning from examples, check src/demo/demo.cpp in the platform directories -
they don't differ much.

Overview:

---------
void mt_init(void)
---------
This function calls TTF_Init() if it has not been called already. This is
checked with TTF_WasInit(). You can achieve the same results with TTF_Init();

---------
void mt_add_item(list<mt_list> *menulist, string label,
        void (*func)(void *), void *arg)
---------
The first argument is a pointer to a mt_list C++ list. This is easily created:

list<mt_list> listthing;    /* listthing is the name of the variable */

The second argument is the text, or label of the item.

Third is a void function pointer with a void argument. The argument is
specified in the fourth argument.

Example:

mt_add_item(&listthing, "Exit Menu", test, (void *)1);

..where test is a void *. For a better example, refer to the demo.

If the last two arguments are NULL, no action will happen when an item is
selected.

---------
void mt_start_menu(list<mt_list> menulist, string title, string font,
        string font_bold, SDL_Surface *screen)
---------
First is an mt_list C++ list. Title is the title of the menu,
this will be at the top in larger bold letters. font is a path to the
default font used to show an unselected item in the menu. font_bold is a
selected item. Lastly, a pointer to the screen surface.

Example:

mt_start_menu(listthing, "Menu Title", "font.ttf", "bold.ttf", screen);

-------------------
License Information
-------------------
See: /COPYING
