//
// Asura_PSP_VRAMManagement.h
//
// Created by JG - 17/11/2005 14:31:19
//
// Copyright (C) 2005 Rebellion, All Rights Reserved.
//

#ifdef ASURA_USE_PRAGMA_ONCE
	#pragma once
#endif

#ifndef __ASURA_PSP_VRAMMANAGEMENT_H__
#define __ASURA_PSP_VRAMMANAGEMENT_H__

const unsigned int uMAX_NUMBER_OF_TEXTURES		= 256; 

class Asura_PSP_VRAMManagement
{
public:
	enum 
	{
		ASURA_PSP_VRAM_INVALID	= -1,
		ASURA_PSP_VRAM_FULL		= uMAX_NUMBER_OF_TEXTURES-1,
	};

	static void		Initialise(); 
	static void		Reset(); 
	static int		AllocateVRAM(unsigned int uSize); 
	static char*	GetVRAM(int iHandler); 
	static bool		IsValidHandler(int iHandler); 

	static void		OnBeginFrame(); 
	static void		OnEndFrame(); 


private:
	static bool				s_bInitialised; 
	static char*			s_pcVRAM; 
	static unsigned int		s_uAllocatedSize;
	static int				s_iCurrentHandler; 
	static int				s_iOffsetHandler; 
	static char*			s_apHandlers[uMAX_NUMBER_OF_TEXTURES-1]; 
	static unsigned int		s_uHitsThisFrame; 
	static unsigned int		s_uFramesWithoutResetting; 
};


#endif//__ASURA_PSP_VRAMMANAGEMENT_H__
