2009-08-14 23:33:01 +00:00
|
|
|
<html><body bgcolor="#FFFFFF" text="#000000"><center><table><tr><td>
|
|
|
|
<!-- --------------------- This file is this wide -------------------------- -->
|
|
|
|
<center><img src="grrlib_logo.png" /></center>
|
|
|
|
<pre><b>
|
2009-08-17 03:42:21 +00:00
|
|
|
|
|
|
|
Table of Contents
|
|
|
|
-----------------
|
|
|
|
|
|
|
|
Introduction
|
|
|
|
...What is it?
|
|
|
|
|
|
|
|
Developing for the Wii
|
|
|
|
...How do I even start?
|
|
|
|
|
|
|
|
Downloading GRRLIB
|
|
|
|
...Where do I get it from?
|
|
|
|
|
|
|
|
Installing GRRLIB
|
|
|
|
...How do I get it to a useable state?
|
|
|
|
|
|
|
|
Using GRRLIB
|
|
|
|
...What essentials do I need to know to get going?
|
|
|
|
|
|
|
|
Upgrading to v4.1.0 From Previous Versions of GRRLIB
|
|
|
|
...I upgraded and now my programs won't compile properly!?
|
|
|
|
|
|
|
|
Error: guVector redefined
|
|
|
|
...How do I get rid of this error?
|
|
|
|
|
|
|
|
Using SVN
|
2009-09-08 09:31:06 +00:00
|
|
|
...What is this SVN thing that the L337 devs keep talking about?
|
2009-08-17 03:42:21 +00:00
|
|
|
|
|
|
|
Credits
|
|
|
|
...Who do I thank for all this free stuff?
|
|
|
|
|
|
|
|
Licence
|
|
|
|
...When you say "free" do you actually mean something else?
|
|
|
|
|
|
|
|
|
2009-08-14 23:33:01 +00:00
|
|
|
Introduction
|
|
|
|
------------
|
|
|
|
|
|
|
|
GRRLIB is a C/C++ 2D Graphics library for Wii application developers. It is
|
|
|
|
essentially a wrapper which presents a friendly interface to the Nintendo GX
|
|
|
|
core.
|
|
|
|
|
2009-08-17 03:42:21 +00:00
|
|
|
This document is written to be viewed with equal clarity in either a web browser
|
|
|
|
or a text editor.
|
|
|
|
|
|
|
|
As of v4.1.0, GRRLIB is supplied as a standard C/C++ library (aka. archive)
|
2009-08-14 23:33:01 +00:00
|
|
|
called 'libgrrlib'. Because GRRLIB processes JPEG and PNG images, it requires
|
|
|
|
the installation of the 'libjpeg' and 'libpngu' libraries. 'libpngu', in turn,
|
2009-09-03 03:28:53 +00:00
|
|
|
requires 'libpng' and 'libpng' requires 'libz'. GRRLIB also has FileIO
|
|
|
|
functions to allow real-time loading and saving of graphical data, and thus also
|
|
|
|
requires 'libfat'.
|
2009-08-14 23:33:01 +00:00
|
|
|
|
2009-09-03 03:28:53 +00:00
|
|
|
libgrrlib <- 2D graphics library
|
|
|
|
+-- libfat <- File I/O
|
|
|
|
+-- libjpeg <- JPEG image processor
|
|
|
|
+-- libpngu <- Wii wrapper for libpng
|
|
|
|
+-- libpng <- PNG image processor
|
|
|
|
+-- libz <- Zip (lossless) compsression (for PNG compression)
|
2009-08-14 23:33:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
Developing for the Wii
|
|
|
|
----------------------
|
|
|
|
|
|
|
|
Do not progress until you have installed and configured devkitPro. Guides are
|
|
|
|
and assistance are available at http://forums.devkitpro.org
|
|
|
|
|
|
|
|
If you have just performed a clean (re)install on your Windows PC, be sure to
|
|
|
|
reboot before you continue.
|
|
|
|
|
|
|
|
|
|
|
|
Downloading GRRLIB
|
|
|
|
------------------
|
|
|
|
|
2009-08-17 03:42:21 +00:00
|
|
|
You are invited to use "the latest SVN trunk version" of GRRLIB at all times.
|
2009-09-08 09:31:06 +00:00
|
|
|
|
|
|
|
The SVN repository is located at: http://grrlib.googlecode.com/svn/
|
|
|
|
|
2009-08-17 03:42:21 +00:00
|
|
|
There is a simple guide to "Using SVN" later in this document.
|
2009-08-14 23:33:01 +00:00
|
|
|
|
|
|
|
This document will presume that you have downloaded "the latest SVN trunk
|
|
|
|
version" to a directory called C:\grr\trunk
|
|
|
|
|
|
|
|
Installing GRRLIB
|
|
|
|
-----------------
|
|
|
|
|
2009-09-03 03:28:53 +00:00
|
|
|
Note: Discussion is underway for 'libpng' and 'libjpeg' to be included with
|
|
|
|
devkitPro - obviously, this means that the "bugfix" included here will
|
|
|
|
be officially addressed and the "precompiled" libraries will /not/ require
|
|
|
|
installation [03-Sept-2009]
|
|
|
|
|
2009-08-14 23:33:01 +00:00
|
|
|
This guide is for Windows. If you are using Linux, I am going to presume you
|
|
|
|
are smart enough to convert these instructions.
|
|
|
|
|
|
|
|
GRRLIB is supplied as source code.
|
2009-08-17 03:42:21 +00:00
|
|
|
libjpeg is supplied as a precompiled library *1
|
2009-08-14 23:33:01 +00:00
|
|
|
libpngu is supplied as source code
|
|
|
|
libpng is supplied as a precompiled library
|
|
|
|
libz is supplied with devkitpro (Ie. preinstalled)
|
2009-09-03 03:28:53 +00:00
|
|
|
libfat is supplied with devkitpro (Ie. preinstalled)
|
2009-08-14 23:33:01 +00:00
|
|
|
|
2009-08-17 03:42:21 +00:00
|
|
|
*1 The version of libjpeg supplied with GRRLIB v4.1.0 contains bug fixes not
|
|
|
|
available in the official release. If you can track down the original
|
|
|
|
author, please tell him about these fixes.
|
2009-08-14 23:33:01 +00:00
|
|
|
|
|
|
|
Because of the way dependancies work, the libraries must be installed in reverse
|
|
|
|
order.
|
|
|
|
|
|
|
|
libz comes preinstalled with devkitPro, so we can move directly to libpng...
|
|
|
|
|
2009-08-17 03:42:21 +00:00
|
|
|
To install libpng *2
|
2009-08-14 23:33:01 +00:00
|
|
|
c:
|
|
|
|
cd \grr\trunk\GRRLIB\lib\png
|
|
|
|
make install
|
|
|
|
|
2009-08-17 03:42:21 +00:00
|
|
|
Next up the list is libpngu *2
|
2009-08-14 23:33:01 +00:00
|
|
|
c:
|
|
|
|
cd \grr\trunk\GRRLIB\lib\pngu
|
2009-09-08 09:31:06 +00:00
|
|
|
make clean all install
|
2009-08-14 23:33:01 +00:00
|
|
|
|
2009-08-17 03:42:21 +00:00
|
|
|
Next up the list is libjpeg *2 *3
|
2009-08-14 23:33:01 +00:00
|
|
|
c:
|
|
|
|
cd \grr\trunk\GRRLIB\lib\jpeg
|
|
|
|
make install
|
|
|
|
|
2009-08-17 03:42:21 +00:00
|
|
|
*2 A Windows batch-file and a Linux shell-script are included which will
|
|
|
|
install the libpng, libpngu and libjpeg libraries in a single command:
|
|
|
|
c:
|
|
|
|
cd \grr\trunk\GRRLIB\lib
|
2009-09-03 03:28:53 +00:00
|
|
|
install <- If you are using Linux, type `./install.sh` instead
|
2009-08-17 03:42:21 +00:00
|
|
|
|
|
|
|
*3 The version of libjpeg supplied with GRRLIB v4.1.0 contains bug fixes not
|
|
|
|
available in the official release.
|
2009-08-14 23:33:01 +00:00
|
|
|
|
2009-08-17 03:42:21 +00:00
|
|
|
After all three image processing libraries are installed, we can now install
|
|
|
|
libgrrlib:
|
2009-08-14 23:33:01 +00:00
|
|
|
c:
|
|
|
|
cd \grr\trunk\GRRLIB\GRRLIB
|
2009-09-08 09:31:06 +00:00
|
|
|
make clean all install
|
2009-08-14 23:33:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
Using GRRLIB
|
|
|
|
------------
|
|
|
|
|
|
|
|
After everything is installed, simply put
|
2009-08-17 03:42:21 +00:00
|
|
|
#include <grrlib.h> <!-- #include <grrlib.h> -->
|
2009-08-14 23:33:01 +00:00
|
|
|
at the top of your .c file and use the functions as required
|
|
|
|
|
|
|
|
You will also need to add
|
2009-09-03 14:15:06 +00:00
|
|
|
-lgrrlib -lfat -ljpeg -lpngu -lpng -lz
|
2009-08-14 23:33:01 +00:00
|
|
|
to the libs line in your makefile
|
|
|
|
...Remember the order of the libraries is critical. You may (need to) insert
|
|
|
|
other libraries in the middle of the list, you may need to add others to the
|
|
|
|
start, or even the end - but do _not_ change the order of the libraries shown
|
|
|
|
here.
|
|
|
|
|
2009-08-17 03:42:21 +00:00
|
|
|
You do NOT need to place /anything/ in your application directory.
|
2009-08-14 23:33:01 +00:00
|
|
|
|
|
|
|
If you would like to see a working example of this, you can look at the example
|
|
|
|
found in: C:\grr\trunk\examples\bluechip\composition
|
|
|
|
...This example also includes a "Makefile" which tries to make it clear what is
|
|
|
|
happening (unlike the more comprehensive cross-platform Makefile supplied with
|
2009-08-17 03:42:21 +00:00
|
|
|
the devkitPro 'template' application).
|
|
|
|
|
|
|
|
|
|
|
|
Upgrading to v4.1.0 From Previous Versions of GRRLIB
|
|
|
|
----------------------------------------------------
|
|
|
|
|
|
|
|
Older versions of GRRLIB, required a line such as:
|
|
|
|
#include "../../../GRRLIB/GRRLIB/GRRLIB.h"
|
|
|
|
...to be placed at the top of each C file which uses GRRLB.
|
|
|
|
Because GRRLIB is now installed as a system library, this must be replaced with:
|
|
|
|
#include <grrlib.h> <!-- #include <grrlib.h> -->
|
|
|
|
|
|
|
|
Older versions of GRRLIB required the 'GRRLIB.h' and 'GRRLIB.c" files to be
|
|
|
|
present in every project which uses GRRLIB.
|
|
|
|
Because GRRLIB is now installed as a system library, these files are no longer
|
|
|
|
required and must be erased.
|
|
|
|
*WARNING* Be careful if you have edited (either of) these files.
|
|
|
|
|
|
|
|
Older versions of GRRLIB "passed 'structs'" and therefore Textured Images were
|
|
|
|
defined with:
|
|
|
|
GRRLIB_texImg tex1, tex2;
|
|
|
|
Because GRRLIB now "passes 'pointers'" these definitions should be changed to:
|
|
|
|
GRRLIB_texImg *tex1, *tex2;
|
|
|
|
|
|
|
|
With older versions of GRRLIB if the programmer (you) required access to the
|
|
|
|
mode and frame information, you were required to add one or more of the
|
|
|
|
following three lines:
|
|
|
|
extern GXRModeObj *rmode;
|
|
|
|
extern void *xfb[2];
|
|
|
|
extern u32 fb;
|
|
|
|
Because GRRLIB now does this for you automatically, these lines must be removed
|
|
|
|
from your code.
|
2009-08-14 23:33:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
Error: guVector redefined
|
|
|
|
-------------------------
|
|
|
|
|
|
|
|
If you get this error, you are probably using a version of libogc more recent
|
|
|
|
than the released v1.7.1a.
|
|
|
|
|
|
|
|
In the libogc SVN revision 3650 Vector was renamed to guVector "to avoid
|
|
|
|
collisions" ...also Quaternion was renamed to guQuaternion - but GRRLIB does
|
|
|
|
not use these!
|
|
|
|
|
|
|
|
The main codebase of GRRLIB has been updated to reflect this change.
|
|
|
|
But until the new libogc is officially released, if you are using a version of
|
|
|
|
libogc later than v1.7.1a/svn3649, you will need to add:
|
|
|
|
-DNOGUFIX
|
|
|
|
to the compiler flags (CFLAGS) in your makefile
|
|
|
|
|
|
|
|
When the libogc changes are officially released, this *temporary fix* should be
|
|
|
|
removed [see grrlib.h, line 50ish]
|
|
|
|
The requirement for -DNOGUFIX will be deprecated, but its lingering presence
|
|
|
|
will not be a hinderance
|
|
|
|
|
|
|
|
Thanks to Nicksasa for reporting this problem
|
|
|
|
|
|
|
|
|
2009-08-17 03:42:21 +00:00
|
|
|
Using SVN
|
|
|
|
---------
|
|
|
|
|
|
|
|
SVN stands for "SubVersioN" ...No it doesn't mean much to me either.
|
|
|
|
|
|
|
|
It allows the developers to submit changes to the code in such a way that
|
|
|
|
these changes can be easily monitored, quickly merged together with other
|
|
|
|
changes. and (if necessary) reverted.
|
|
|
|
|
|
|
|
It also allows the power-users to gain access to the latest (often "in-test")
|
|
|
|
features.
|
|
|
|
|
|
|
|
SVN is classically divided in to three chunks:
|
|
|
|
trunk - The main development & release code.
|
|
|
|
branches - Sometimes a developer may spend a week-or-more making their changes,
|
|
|
|
so (s)he will work in a copy of the code until the changes are
|
|
|
|
approved by the project leader ...then the changes are "merged" back
|
|
|
|
in to trunk.
|
|
|
|
tags - These are just copies of the code at critical points, such as
|
|
|
|
official releases.
|
|
|
|
GRRLIB conforms to this official guideline.
|
|
|
|
|
|
|
|
To obtain the "cutting edge" codebase (ie. the latest in SVN) you need an SVN
|
|
|
|
tool ...The same as: if you want to view a web page, you need a web browser
|
|
|
|
|
|
|
|
For Windows you will choose: TortoiseSVN
|
|
|
|
For Debian you will choose: apt-get install subversion
|
|
|
|
For others you will need to do a bit of research (I only use Debian & Windows)
|
|
|
|
|
|
|
|
Windows:
|
|
|
|
Create a directory to hold the code (Eg. C:\grr)
|
|
|
|
Right click it and choose "svn checkout"
|
|
|
|
Enter the URL of the SVN 'repository': http://grrlib.googlecode.com/svn/
|
|
|
|
Click the [...] button and choose the trunk*
|
|
|
|
Leave advanced options alone (Ie. fully recursive, head)
|
|
|
|
Hit OK
|
|
|
|
|
|
|
|
Linux:
|
|
|
|
Create a directory to hold the code (Eg. `mkdir -p /home/user/src/grr`)
|
|
|
|
Change to that directory (Eg. `cd /home/user/src/grr`)
|
|
|
|
type `svn checkout http://grrlib.googlecode.com/svn/trunk/ grrlib-read-only`*
|
|
|
|
|
|
|
|
* You may choose to check-out any part of the repository you wish, but if you
|
|
|
|
venture outide 'trunk' you are likely to get old or broken code.
|
|
|
|
|
|
|
|
If you network connection dies half-way through the download
|
|
|
|
Windows: ...simply right-click the directory again and choose "SVN Update"
|
|
|
|
Linux: ...Simply type `svn update`
|
|
|
|
|
|
|
|
You may also perform an "update" any time you like to get the latest & greatest
|
|
|
|
code changes. But be warned, if you have edited the GRRLIB source code things
|
|
|
|
can (and often do) get messy. The best help you can get about this is probably
|
|
|
|
here: http://svnbook.red-bean.com/en/1.1/svn-book.html#svn-ch-3-sect-5.4
|
|
|
|
|
|
|
|
|
2009-08-14 23:33:01 +00:00
|
|
|
Credits
|
|
|
|
-------
|
|
|
|
|
|
|
|
Project Leader : NoNameNo
|
2009-08-17 03:42:21 +00:00
|
|
|
Documentation : Crayon, BlueChip
|
2009-08-14 23:33:01 +00:00
|
|
|
Lead Coder : NoNameNo,
|
2009-09-04 15:30:06 +00:00
|
|
|
Support Coders : Crayon, Xane, DragonMinded, BlueChip, elisherer
|
2009-09-08 09:31:06 +00:00
|
|
|
Advisors : RedShade, Jespa
|
2009-08-14 23:33:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
Licence
|
|
|
|
-------
|
|
|
|
|
|
|
|
GRRLIB is released under the MIT Licence. If we had chosen the GPL licence you
|
|
|
|
would be +forced+ (legally required) to release your source code. But in the
|
|
|
|
spirit of "free as in FREE" we have left you with the +option+ to release your
|
|
|
|
source code.
|
|
|
|
|
2009-09-08 09:31:06 +00:00
|
|
|
We do +request+ that you tell others about us by naming our library (GRRLIB) in
|
|
|
|
the credits of your game/application. And, if you +choose+ to do that, we
|
2009-08-14 23:33:01 +00:00
|
|
|
encourage you to use our logo to achieve it; You can find our logo here:
|
|
|
|
C:\grr\trunk\grrlib_logo.png
|
|
|
|
and here:
|
|
|
|
http://grrlib.santo.fr/wiki/images/logo.png
|
|
|
|
|
|
|
|
This is the official license text
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
Copyright (c) 2009 The GRRLIB Team
|
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
|
|
all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
THE SOFTWARE.
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
[BlueChip]
|
|
|
|
|
|
|
|
</b></pre></td></tr></table></center></body></html>
|