/*
 * PSP SHELL SDK
 * -----------------------------------------------------------------------
 * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
 *
 * main.c - Basic Texture and String Rendering Sample
 *
 */

#include <pspkernel.h>
#include <stdio.h>

#include "./../include/gfxmgr.h"


/* Define the module info section */
PSP_MODULE_INFO("tex_string_plugin_sample", 0, 1, 1);


/* Define the main thread's attribute value (optional) */
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);

int main(int argc, char *argv[])
{
	printf("Tex String plugin\n");
	
	
	sceKernelDelayThread(4000000);
	
	gfxMgrWaitModule();
	
	gfxMgrTwoOptionDialog("This is a sample dialog from texture plugin", 1, "hi", "bye");

	void* image = gfxMgrLoadTexture("tex.png");

	
	while (1) 
	{
		// Give other modules the chance to use gfxMgr
		gfxMgrWaitModule();
		
		gfxMgrRenderTexture(image, 0, 0, 255, 45, 240, 136);
		gfxMgrRenderTexture(image, 30, 40, 255, 0, 120, 68);
		
		gfxMgrRenderString("HELLO WORLD!", 0.5f, 0xFFFFFF00, 0.f, 0, 0, 240, 136);
		
		// Must delay to prevent PSP sleep failure
		sceKernelDelayThread(5000);
	}
	
	return 0;
}
