1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html> 3 4<head> 5<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 6<META name="GENERATOR" content="Microsoft FrontPage 5.0"> 7<META http-equiv="Content-Style-Type" content="text/css"> 8<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css"> 9<title>DEMO Font</title> 10</head> 11 12<body> 13 14<h1 align="left">DEMO Font Functions</h1> 15 16<h2>Syntax</h2> 17<dl><dd><pre class="construction"> 18#include <demo.h> 19 20typedef enum 21{ 22 DMTF_POINTSAMPLE, // Point sampling 23 DMTF_BILERP // Bilerp filtering 24} DMTexFlt; 25 26#define DM_FT_OPQ 0 // Opaque 27#define DM_FT_RVS 1 // Reverse 28#define DM_FT_XLU 2 // Translucent 29 30void DEMOInitCaption( s32 ftype, s32 swidth, s32 sheight); 31void DEMOPrintf ( s16 x, s16 y, s16 z, char* fmt, ... ); 32void DEMOPuts ( s16 x, s16 y, s16 z, char* str); 33 34void DEMOSetFontType( s32 ftype ); 35void DEMOSetupScrnSpc( s32 swidth, s32 sheight, float depth); 36void DEMOLoadFont ( GXTexMapID tmap, GXTexMtx tmat, DMTexFlt tflt); 37void DEMOMtxScreen( Mtx mmtx, Mtx44 mprj, float vpw, float vph, float near); 38</pre></dd></dl> 39 40<h2>Arguments</h2> 41<TABLE class="arguments" border="1" > 42 <tr> 43<TH>ftype</TH> 44<TD>Font type. Determines the GX blend mode.</TD> 45 </tr> 46 <tr> 47<TH>swidth</TH> 48<TD>Screen width.</TD> 49 </tr> 50 <tr> 51<TH>sheight</TH> 52<TD>Screen height.</TD> 53 </tr> 54 <tr> 55 <TH>...</TH> 56<TD>Plans for future additions.</TD> 57 </tr> 58</TABLE> 59 60<h2>Return Values</h2> 61<P>None.</P> 62 63<H2>Description</H2> 64<P>This DEMO font library provides a simple means for displaying text on screen. The text character set is defined using a texture map, and text characters are rendered by rendering texture rectangles.</P> 65<P>The <code>DEMOInitCaption</code> function initializes the font system and the <code>DEMOPrintf</code> commands can immediately follow. <code>DEMOInitCaption</code> takes three arguments: font type, screen width, and screen height. The font type controls the GX blending mode and determines if the text is white on black, black on white, or white on transparent. Other text colors and backgrounds are available, but require that the TEV and color channels be set manually. The <code>DEMOInitCaption</code> function also initializes a projective transformation matrix that places the origin in the upper left corner of the screen and maps (X, Y) to absolute pixel coordinates relative to the origin. The default Z-value range is from 0 to 100.</P> 66<P>The <code>DEMOPrintf</code> and <code>DEMOPuts</code> functions render text strings. Carriage returns are also read, but any other nondisplayable text characters are interpreted as EOL markers. The position passed to the function specifies the upper left corner for the first text character to display (also establishes the left margin for carriage returns). Each text character is defined by an 8 x 8 cell including spaces.</P> 67<P>The <code>DEMOSetFontType</code> function can be used to change the font type (GX blend mode) without reinitializing everything. The <code>DEMOSetupScrnSpc</code> function can be used to modify projections and transformations. The <code>DEMOLoadFont</code> function may be used to modify texture filtering. <code>DEMOMtxScreen</code> function returns a matrix that specifies the screen to camera transformation.</P> 68 69<H3>Example Program</H3> 70<P>The GX and other demos use this example program.</P> 71 72<h2>See Also</h2> 73<P>None.</P> 74 75<H2>Revision History</H2> 76<P> 772006/03/01 Initial version.<br> 78</P> 79 80<hr><p>CONFIDENTIAL</p></body> 81</html>