#ifndef CGRAPHIC_SYSTEM
#define CGRAPHIC_SYSTEM

#include "STRINGC.h"
#include "Singleton.h"
#include <windows.h>

class CImage;
class CImageMod;

#define g_GraphicSystem CGraphicSystem::GetSingleton()

class CGraphicSystem: public Singleton <CGraphicSystem>
{

public:
	
	virtual ~CGraphicSystem(){ };

	virtual bool Init(int Width, int Height)=0;
	virtual bool Shutdown()=0;

	virtual getWidth(){ return ScrWidth;}
	virtual getHeight(){ return ScrHeight; }

	//----------------------------------------------------------------//
	//	Window Creating Fullscreen/Windowed mode toggle, etc
	//----------------------------------------------------------------//

	virtual HRESULT Create( HINSTANCE hInstance )=0;
	virtual INT     Run()=0;
	virtual LRESULT MsgProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )=0;


	//----------------------------------------------------------------//
	//	Frame prepping/drawing/release
	//----------------------------------------------------------------//


	virtual void PrepFrame()=0;		
	virtual void DrawFrame()=0;		
	virtual void ReleaseFrame()=0;	


	//----------------------------------------------------------------//
	//	Drawing/Blitting Functions
	//----------------------------------------------------------------//


	virtual void DrawPixel(int, int)=0;
	virtual void DrawLine(int x1, int y1, int x2, int y2, DWORD color)=0;
	virtual void DrawHLine(int x1, int x2, int y)=0;
	virtual void DrawVLine(int x, int y1, int y2)=0;
	virtual void FillScreen(int r, int g, int b)=0;
	virtual void DrawRect(RECT r)=0;

	virtual void DrawCImage(CImage* img,int x, int y)=0;	

	virtual CImage* LoadCImage(STRINGC fileName)=0;


	virtual void PrintText(STRINGC txt, int x, int y)=0;
	virtual void setGlobalScale(float x, float y){ m_globalScaleX = x, m_globalScaleY=y; }
	

protected:

	int			 ScrWidth, ScrHeight;
	float		 m_globalScaleX;			//Every image will get scaled by this factor
	float		 m_globalScaleY;			//Every image will get scaled by this factor







};



#endif