//ds2_main.c
#include <libBAG.h>

//declare a font object
FNTObj_t Font;

void ds2_main(void){
	if(!BAG_Init(1))
		ds2_plug_exit();

	//initiate debug text
	//DBG_HALT - stops the program on any debug message
	//DBG_LIB - displays debug messages from libBAG functions
	BAG_DBG_Init(NULL, DBG_HALT | DBG_LIB);
		

	BAG_DBG_Msg("Loading Font!\n");
	//loads either test.bmp or test.ttf based on what ever it can find first
	int error = BAG_Font_LoadFontExt("/test", &Font);
	BAG_DBG_Msg("error: %d\n", error);
	if(error == ERR_NONE){
		BAG_DBG_Msg("Drawing character!\n");
		BAG_Print(down_screen_addr, &Font, "Hello World!", 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, RGB15(31,31,31));
		ds2_flipScreen(DOWN_SCREEN, 0);
		BAG_DBG_Msg("character drawn!\n");
	}
		
	while(1){
		BAG_Update();
	}
}

