/*
	GLPRINTF.C

	This program demonstrates how to use glprintf to print some text on
	the lcd screen. If you are using Dynamic C Deluxe, you can uncomment
	the glXFontInit call and comment out the glFontInit call.
*/

#use wintek.lib					//	specify underlying LCD
#use glcd.lib						//	specify high level graphics library

main() {
	auto struct _fontInfo fi;	//	declare struct to hold font information
	
	glInit();		//	initialize the software and hardware modules

	//	the following call is possible only for Deluxe versions of the
	//	compiler because it relies on the "xdata" construct to place
	//	the font bitmap in xmem
/*	
	glXFontInit(	//	initialize the font info structure needed later
		&fi,			//	pointer to the font info structure to fill
		6,				//	horizontal size (in pixels) of each character
		8,				//	vertical size (in pixels) of each character
		32,			//	beginning code of printable characters
		127,			//	ending code of printable characters
		engFont6x8	//	address of font bitmap in xmem
		);
*/
	//	the following call works for both standard and deluxe versions of
	//	the compiler because the font bitmap is in root memory.
	
	glFontInit(		//	initialize the font info structure needed later
		&fi,			//	pointer to the font info structure to fill
		6,				//	horizontal size (in pixels) of each character
		8,				//	vertical size (in pixels) of each character
		32,			//	beginning code of printable characters
		127,			//	ending code of printable characters
		engFont6x8R	//	address of font bitmap in root memory
		);
		
	glPrintf(		//	print some text on the screen!
		0,				//	x-position of right extreme of text to display
		0,				//	y-position of top extreme of text to display
		&fi,			//	font info structure
		"Something on\nthe screen!"	//	the string to print out
		);
}