Ninja Library - System Function

njInitPrint

Initializes characters for debug

FORMAT

void njInitPrint( *texture, size, attr );
Uint32 *texture
Uint32 size
Uint32 attr

PARAMETER

 texture  Pointer to debug font texture  
 size  Width size of texture (only valid in the case of square texture) 
 attr  Texture category, color type 

RETURN

None

DESCRIPTION

Initializes characters for debug. Following setting of the njlnitVertexBuffer() function, initialization takes place and njlnitPrint() is set. When using default font, set texture parameters to NULL. When the user specifies the font, the data part of the PVR format square texture becomes the font data. Set the texture category and color type in attr.

 NJD_TEXFMT_TWIDDLED  (0x0100) 
 NJD_TEXFMT_TWIDDLED_MM  (0x0200) 
 NJD_TEXFMT_VQ  (0x0300) 
 NJD_TEXFMT_VQ_MM  (0x0400) 
 NJD_TEXFMT_PALETTIZE4  (0x0500) 
 NJD_TEXFMT_PALETTIZE4_MM  (0x0600) 
 NJD_TEXFMT_PALETTIZE8  (0x0700) 
 NJD_TEXFMT_PALETTIZE8_MM  (0x0800) 
 NJD_TEXFMT_RECTANGLE  (0x0900) 
 NJD_TEXFMT_STRIDE  (0x0B00) 
 NJD_TEXFMT_ARGB_1555  (0x00) 
 NJD_TEXFMT_RGB_565  (0x01) 
 NJD_TEXFMT_ARGB_4444  (0x02) 
 NJD_TEXFMT_YUV_422  (0x03) 
 NJD_TEXFMT_ARGB_8888  (0x06) 

The default font is size 128 of the ARGB1555Twiddled texture. The debug font can also be registered in the texture memory but Nindows cannot show it.

Order of font data

<IMG SRC="debug.gif" BORDER=0><BR>


EXAMPLE

/* Use default debugger font */
void njUserInit(void)
{
	sbInitSystem( NJD_RESOLUTION_640x480_NTSCI, NJD_FRAMEBUFFER_MODE_RGB555, 1 );
	njInitVertexBuffer( 800000, 0, 200000, 0 ,0);
	njInitPrint(NULL,0,0);
t:
}
Sint32 njUserMain(void)
{
	njPrint(NJM_LOCATION(10,10),"Count = %d",count); 
t:
}
void njUserExit(void)
{
	njExitPrint();
t:
}
/* Use user-set debugger font */
Uint32 texture[];/* Font texture (PVR texture data part) */
void njUserInit(void)
{
	sbInitSystem( NJD_RESOLUTION_640x480_NTSCI, NJD_FRAMEBUFFER_MODE_RGB555, 1 );
	njInitVertexBuffer( 800000, 0, 200000, 0 ,0);
	njInitPrint(texture,128,NJD_TEXFMT_TWIDDLED|NJD_TEXFMT_ARGB_1555);
t:
}
Sint32 njUserMain(void)
{
	njPrint(NJM_LOCATION(10,10),"Count = %d",count); 
t:
}
void njUserExit(void)
{
	njExitPrint();
t:
}

NOTE

When the mode is changed, and once the njExitPrint() function is terminated, reset again after njlnitVertexBuffer() function is terminated.

REFERENCE

njExitPrint()

njInitPrint
COPYRIGHT © SEGA ENTERPRISES, LTD., 1998,1999