1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<HTML>
3<HEAD>
4<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
5<META name="GENERATOR" content="Microsoft FrontPage 5.0">
6<META http-equiv="Content-Style-Type" content="text/css">
7<LINK rel="stylesheet" type="text/css" href="../../../CSS/revolution.css">
8<LINK rel="stylesheet" type="text/css" href="../../../CSS/revolution.css">
9<TITLE>G2D-test</TITLE>
10</HEAD>
11<BODY link="#0000ff" vlink="#800080">
12<H1>G2D-test</H1>
13<H2>Description</H2>
14<P>An example game demo that uses the G2D library. This game demo demonstrates the following:</P>
15<UL>
16<LI>How layers can comprise tiles of different materials.
17<LI>How to design tiles so that the viewport can be rotated without creating artificial aliasing.
18<LI>How to compose and separately scroll multiple layers.
19</UL>
20<P>For details about this library, refer to the 2D Graphics Library (G2D) in the <em>Revolution Graphics Programmer's Guide</em>.</P>
21<H2>Coverage</H2>
22<TABLE border="1" cellpadding="3" cellspacing="0.1" width="640">
23  <TBODY>
24    <TR>
25<TD width="30%" valign="middle" bgcolor="#C0C0C0"><EM><STRONG>Function</STRONG></EM></TD>
26<TD width="25%" valign="middle" bgcolor="#C0C0C0"><EM><STRONG>Parameters</STRONG></EM></TD>
27<TD width="45%" valign="middle" bgcolor="#C0C0C0"><EM><STRONG>Description</STRONG></EM></TD>
28    </TR>
29    <TR>
30<TD width="30%"><FONT face="Courier New">G2DinitSprite</FONT></TD>
31<TD width="25%"><EM><STRONG><FONT face="Courier New"><STRONG><EM><CODE>sprite</CODE></EM></STRONG></FONT></STRONG></EM></TD>
32<TD width="45%" valign="MIDDLE">Pointer to <font face="Courier New">G2DSprite</font> structure.</TD>
33    </TR>
34    <TR>
35<TD width="30%" rowspan="2"><FONT face="Courier New"><CODE>G2DDrawSprite</CODE></FONT></TD>
36<TD width="25%"><EM><STRONG><FONT face="Courier New"><STRONG><EM><CODE>sprite</CODE></EM></STRONG></FONT></STRONG></EM></TD>
37<TD width="45%" valign="MIDDLE">Pointer to <font face="Courier New">G2DSprite</font> structure.</TD>
38    </TR>
39    <TR>
40<TD width="25%"><EM><STRONG><FONT face="Courier New"><STRONG><CODE><CODE>po</CODE></CODE></STRONG></FONT></STRONG></EM></TD>
41<TD width="45%" valign="MIDDLE">Pointer to the <font face="Courier New">G2DPosOri</font> structure to which the position and orientation of the sprite have been passed.</TD>
42    </TR>
43    <TR>
44<TD width="30%" rowspan="2"><FONT face="Courier New"><CODE>G2DDrawLayer</CODE></FONT></TD>
45<TD width="25%"><EM><STRONG><FONT face="Courier New"><STRONG><EM><CODE>layer</CODE></EM></STRONG></FONT></STRONG></EM></TD>
46<TD width="45%" valign="MIDDLE">Pointer to the <font face="Courier New">G2DLayer</font> structure.</TD>
47    </TR>
48    <TR>
49<TD width="25%"><EM><STRONG><FONT face="Courier New"><STRONG><EM><CODE>aSortBuffer</CODE></EM></STRONG></FONT></STRONG></EM></TD>
50<TD width="45%" valign="MIDDLE">Pointer to work buffer.</TD>
51    </TR>
52    <TR>
53<TD width="30%"><FONT face="Courier New"><CODE>G2DSetCamera</CODE></FONT></TD>
54<TD width="25%"><EM><STRONG><FONT face="Courier New"><STRONG><CODE><CODE>po</CODE></CODE></STRONG></FONT></STRONG></EM></TD>
55<TD width="45%" valign="MIDDLE">Pointer to the <font face="Courier New">G2DPosOri</font> structure to which the position and orientation of the camera have been passed.</TD>
56    </TR>
57    <TR>
58<TD width="30%" rowspan="2"><FONT face="Courier New"><CODE>G2DInitWorld</CODE></FONT></TD>
59<TD width="25%"><EM><STRONG><FONT face="Courier New"><STRONG><EM><CODE>nWorldX</CODE></EM></STRONG></FONT></STRONG></EM></TD>
60<TD width="45%" valign="MIDDLE">Width of world space in pixels.</TD>
61    </TR>
62    <TR>
63<TD width="25%"><EM><STRONG><FONT face="Courier New"><STRONG><EM><CODE>nWorldY</CODE></EM></STRONG></FONT></STRONG></EM></TD>
64<TD width="45%" valign="MIDDLE">Height of world space in pixels.</TD>
65    </TR>
66    <TR>
67<TD width="30%" rowspan="4"><FONT face="Courier New"><CODE>G2DSetViewport</CODE></FONT></TD>
68<TD width="25%"><EM><STRONG><FONT face="Courier New"><STRONG><EM><CODE>nLeft</CODE></EM></STRONG></FONT></STRONG></EM></TD>
69<TD width="45%" valign="MIDDLE">The left side of the screen space coordinates for viewport.</TD>
70    </TR>
71    <TR>
72<TD width="25%"><EM><STRONG><FONT face="Courier New"><STRONG><EM><CODE>nTop</CODE></EM></STRONG></FONT></STRONG></EM></TD>
73<TD width="45%" valign="MIDDLE">The upper side of the screen space coordinates for viewport.</TD>
74    </TR>
75    <TR>
76<TD width="25%"><EM><STRONG><FONT face="Courier New"><STRONG><EM><CODE>nWidth</CODE></EM></STRONG></FONT></STRONG></EM></TD>
77<TD width="45%" valign="MIDDLE">Width of viewport in screen space coordinates.</TD>
78    </TR>
79    <TR>
80<TD width="25%"><EM><STRONG><FONT face="Courier New"><STRONG><EM><CODE>nHeight</CODE></EM></STRONG></FONT></STRONG></EM></TD>
81<TD width="45%" valign="MIDDLE">Height of viewport in screen space coordinates.</TD>
82    </TR>
83    <TR>
84<TD width="30%"><FONT face="Courier New"><CODE>GXPosition2f32</CODE></FONT></TD>
85<TD width="25%"><EM><STRONG><FONT face="Courier New"><STRONG><EM><CODE>X, Z</CODE></EM></STRONG></FONT></STRONG></EM></TD>
86<TD width="45%" valign="MIDDLE"><STRONG><EM><CODE>x</CODE></EM></STRONG>- and <STRONG><EM><CODE>z</CODE></EM></STRONG>-coordinates of vertex (used by <CODE>G2D.c</CODE> instead of a sample demo).</TD>
87    </TR>
88  </TBODY>
89</TABLE>
90<H2>Operation Method</H2>
91<P>The following is a summary of the control methods:</P>
92<TABLE border="1" cellpadding="3" cellspacing="0.1">
93  <TBODY>
94    <TR>
95<TD width="25%" valign="middle" align="left" bgcolor="#C0C0C0"><EM><STRONG>Button</STRONG></EM></TD>
96<TD width="30%" valign="middle" align="left" bgcolor="#C0C0C0"><EM><STRONG>Normal / Bounce Mode</STRONG></EM></TD>
97    </TR>
98    <TR>
99<TD width="25%">START</TD>
100<TD width="30%">Exits the demo.</TD>
101    </TR>
102    <TR>
103<TD width="25%">Control Stick</TD>
104<TD width="30%">Move ship.</TD>
105    </TR>
106    <TR>
107<TD width="25%">L and R</TD>
108<TD width="30%">Rotate ship.</TD>
109    </TR>
110    <TR>
111<TD width="25%">A</TD>
112<TD width="30%">No function.</TD>
113    </TR>
114    <TR>
115<TD width="25%">B</TD>
116<TD width="30%">Brake ship.</TD>
117    </TR>
118    <TR>
119<TD width="25%">Y</TD>
120<TD width="30%">Cycles mode.</TD>
121    </TR>
122    <TR>
123<TD width="25%">X</TD>
124<TD width="30%">No function.</TD>
125    </TR>
126  </TBODY>
127</TABLE>
128<H2>Snapshot</H2>
129<P><IMG src="./images/g2d-test-1.jpg" alt="g2d-test-1.jpg (101393 bytes)" width="640" height="480"></P>
130<H2>Required Data Files</H2>
131<P>Requires <CODE>g2d-00.tpl</CODE> from directory <CODE>$REVOLUTION_SDK_ROOT/dvddata/gxTests</CODE>.</P>
132<H2>Revision History</H2>
133<P>03/01/2006 Initial version.</P>
134</BODY>
135</HTML>