//
// Asura_PS3_QuadOverlayRenderer.h
//
// Created by KJFL - 03 August 2005
//
// Copyright (C) 2005 Rebellion, All Rights Reserved.
//

#ifdef ASURA_USE_PRAGMA_ONCE
#pragma once
#endif

#ifndef __ASURA_PS3_QUADOVERLAYRENDERER_H__
#define __ASURA_PS3_QUADOVERLAYRENDERER_H__

// Engine platform-specific.
#include "Rendering/Shaders/Asura_PS3_GCM_Shader.h"
#include "Rendering/Asura_PS3_GCM_VertexBuffer.h"

class Asura_Overlay_Quad;
class Asura_PS3_Texture;

#define ASURA_QUAD_BUFFERS		4

class Asura_PS3_QuadOverlayRenderer
{
public:

	static void Initialise( void );
	static void Shutdown( void );

	static void Render( const Asura_Overlay_Quad& xQuad );
	static void RenderHDR( void );
	static void RenderCurrentRenderTarget( const Asura_Overlay_Quad& xQuad, Asura_PS3_FragmentShader* pxShader = NULL, bool bUseViewportSize = true, u_int uiWidth = 0, u_int uiHeight = 0 );
	static void RenderEx( const Asura_Overlay_Quad& xQuad, Asura_PS3_Texture* pxTexture, bool bUseViewportSize = true, u_int uiWidth = 0, u_int uiHeight = 0, bool bPointSample = false );
#ifdef ASURA_PS3_USE_GAMMA_CORRECTION
	static void RenderGamma( const Asura_Overlay_Quad& xQuad, Asura_PS3_Texture* pxTexture, bool bUseViewportSize = true, u_int uiWidth = 0, u_int uiHeight = 0 );
	static void SetGamma( float fGamma ) { m_fGamma = fGamma; }
#endif
	static void Render( const Asura_Overlay_Quad& xQuad, Asura_PS3_Texture* pxTexture, Asura_PS3_FragmentShader* pxShader, bool bNormalizedCoordinates, bool bUseViewportSize = true, u_int uiWidth = 0, u_int uiHeight = 0 );
	static void RenderEx( const Asura_Overlay_Quad* xQuad ); // This allows rendering a quad using a specific FP and a specific render target. You need to set the Render Target, Textures, and Rendering States before calling this function.

	static void Flush( void );

	static void EndFrame( void );
protected:
	static Asura_PS3_GCM_VertexBuffer		s_xVertexBuffer[ ASURA_QUAD_BUFFERS ];
#ifdef ASURA_PS3_USE_GAMMA_CORRECTION
	static float m_fGamma;
#endif
};

#endif//__ASURA_PS3_QUADOVERLAYRENDERER_H__
