#pragma once

#include <d3dx9.h>

class CDirect3D
{
private:
    void Init(HWND Wnd, bool Fullscreen, int Width, int Height);

public:
	//Constructors
	CDirect3D(HWND Wnd, bool Fullscreen, int Width, int Height);
	CDirect3D(HWND Wnd);
	CDirect3D();
	~CDirect3D();

public:
	//Public Members
	LPDIRECT3D9 g_pD3D; 
	LPDIRECT3DDEVICE9 g_pd3dDevice; 
	D3DFORMAT m_d3dfmtTexture;           // Pixel format for textures
    D3DDISPLAYMODE m_DesktopMode;
	bool Initialized;

	int Width;
	int Height;
	bool Fullscreen;
	HWND hWnd;
public:
	//Public Methods	
	
	//--------------------------------------------
	//Clear the screen and Z-buffer
	//--------------------------------------------
	void Clear();
	//--------------------------------------------
	//Shows the back Buffer
	//--------------------------------------------
	void SwapBuffers();
	//--------------------------------------------
	//Get Texture Format
	//--------------------------------------------
	D3DFORMAT GetTextureFormat();
private:
	void InitParameters();
	void InitMatricies();
	void InitLights();
	void Init3DParameters(D3DPRESENT_PARAMETERS &params);

};
