//
// Asura_Direct3D_BackBufferCapture.h
//
// Created by RJF - 14 September 2004
//
// Copyright (C) 2004 Rebellion, All Rights Reserved.
//

#ifdef ASURA_USE_PRAGMA_ONCE
#pragma once
#endif

#ifndef __ASURA_DIRECT3D_BACKBUFFERCAPTURE_H__
#define __ASURA_DIRECT3D_BACKBUFFERCAPTURE_H__

#include "Rendering/Asura_Direct3D.h"

class Asura_Direct3D_BackBufferCapture
{
public:

	// Don't call Initialise() yourself - it's called internally for you.
	// Just call CaptureCurrentBackBuffer() directly.
	static bool Initialise();
	// Shutdown should be called by the Asura_Direct3D code
	static void Shutdown();

	static Direct3D_Texture* GetCaptureTexture();
	static void CaptureCurrentBackBuffer();
	static bool IsCaptureDirty();
	static bool HasCapturedThisFrame();

	// AdviseNextFrame should be called by Asura_Direct3D at the beginning of a new frame
	static void AdviseNextFrame();

private:
	struct BackBufferData
	{
	    Direct3D_Texture* m_pxCaptureTexture;
		Direct3D_Surface* m_pxCaptureSurface;
		u_int m_uCaptureWidth;
		u_int m_uCaptureHeight;
		bool m_bIsDirty;
		bool m_bHasCapturedThisFrame;
	};
	static BackBufferData LDR;
#if defined ASURA_USE_HDR
	static BackBufferData HDR;
#endif
	
};

#endif//__ASURA_DIRECT3D_BACKBUFFERCAPTURE_H__
