#use op71l.lib						//	specify underlying LCD
#use op71hw.lib						//	specify high level graphics library
#use engfontl.lib

main() {
	auto struct _fontInfo fi, bigFi;	//	declare struct to hold font information
	auto unsigned x,y,z;
	auto unsigned long timeMark;
	
	outport(DCNTL,(inport(DCNTL)&0xf)|0x60);	//	setup 2 I/O wait and 1 mem wait states
	glInit();		//	initialize the software and hardware modules

	op71BackLight(1);

	op71SetContrast(45);
	
	//	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

	glBlankScreen();		//	blank the screen

	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
		255,			//	ending code of printable characters
		engFont6x8	//	address of font bitmap in xmem
		);
		
//	glXFontInit(	//	initialize the font info structure needed later
//		&bigFi,		//	pointer to the font info structure to fill
//		17,				//	horizontal size (in pixels) of each character
//		35,				//	vertical size (in pixels) of each character
//		32,			//	beginning code of printable characters
//		127,			//	ending code of printable characters
//		engFont17x35a	//	address of font bitmap in xmem
//		);

	y = 0;
	while (y < 8*37) {
		glSetBrushType(GL_BLOCK);
		glPrintf(0,y,&fi,"This is something to block out");
		glPrintf(0,y,&fi,"******************");
		y+=8;
		glSetBrushType(GL_SET);
		glPrintf(0,y,&fi,"This is something to overwrite");
		glPrintf(0,y,&fi,"******************");
		y+=8;
		glSetBrushType(GL_XOR);
		glPrintf(0,y,&fi,"This is something to flip");
		glPrintf(0,y,&fi,"******************");
		y+=8;
		glPrintf(0,y,&fi,"This is something to clear");
		glSetBrushType(GL_CLEAR);
		glPrintf(0,y,&fi,"******************");
		y+=9;
		hitwd();
	}
}