/*
/ BSTMDISPLAY.H
/ *************
/ A display can be thought of as a plane that
/ a scene can be rendered to. This implementation
/ handles the surface creation and post-processing
/ effects. 
/
/ Will Beddow 2010 - http://343gs.com/brainstem
/
/ This software is currently under development
/ and is subject to change and improvement. Some
/ aspects of the system are incomplete and/or 
/ unstable due to ongoing implementation.
/
*/

#ifndef __BSTMDISPLAY_H__
#define __BSTMDISPLAY_H__

#include "Compile.h"
#include "Types.h"
#include "Display.h"

#include <vector>
#include <iostream>
#include <d3dx9.h>
#include <DxErr.h>

namespace Brainstem
{
	class Display : public IDisplay
	{
	public:
		Display(IDirect3DDevice9* device);
		~Display();

		void AddEffect(const char* name);
		const char* GetEffect(int i) { return Effects[i]; }
		int GetEffectCount() { return Effects.size(); }

		D3DXCOLOR ToD3DXColor(Color color) { return D3DXCOLOR(color.R, color.G, color.B, color.A); }
		D3DXVECTOR4 ToD3DXVector(Color color) { return D3DXVECTOR4(color.R, color.G, color.B, color.A); }

		void RemoveEffect(int i) 
		{ 
			if (i >= 0 && i < Effects.size()) 
				Effects.erase(Effects.begin() + i);
		}

		void Release();

		IDirect3DSurface9* Target;
		IDirect3DTexture9* Texture;

		AUTO_OBJECT_SIZE;
		const char* GetName() { return "Display"; }

	private:
		std::vector<const char*> Effects;
	};
}

#endif