
#include <oslib/oslib.h>


PSP_MODULE_INFO("Devslib Sample", 0, 1, 1);
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);


//declaration
OSL_EFFECT *FxCube1;
int Annimation = 0;

void Touche();



int main(int argc, char* argv[])
{


	//Initialisation
	oslInit(0);							//la lib
	oslInitGfx(OSL_PF_8888, 1);			//Gfx
	oslInitAudio();						//Sound

	FxCube1 = oslLoadCubeEffect("media/fond.png",480,272,0, 100, 16);
	oslResetEffect(FxCube1);


	while (!osl_quit)
	{
		oslStartDrawing();
		oslCls();

		Touche();

		oslActiveCubeFX(FxCube1);

		oslLogoDrawTiles(FxCube1);

		oslPrintColorShadow(0, 20,JAUNE,"Appuyer sur Rond ou Croix", 0);
	
		if (osl_keys->pressed.start)break;	

		oslSynchronization();

	}

	oslEndGfx();
	oslQuit();
	return 0;
}




void Touche()
{
	oslReadKeys();

	if (osl_keys->held.circle){
		oslResetEffect(FxCube1);
		FxCube1->type = 1;
	}

	if (osl_keys->held.cross){
		oslResetEffect(FxCube1);
		FxCube1->type = 0;
	}
	
	
	
}
