#include "DXUT.h"
#include "DXUTmisc.h"
#define DIRECTINPUT_VERSION 0x0800
#include <dinput.h>

#pragma once

class DiManager
{
	private:
	DiManager(void);
	static DiManager* instance;
	LPDIRECTINPUT8 directInput;
	LPDIRECTINPUTDEVICE8 directInputMouse;
	LPDIRECTINPUTDEVICE8 directInputKeyboard;

	BYTE keyboardState[256];
	DIMOUSESTATE mouseState;
	
	public:
	void initDirectInput();
	D3DXVECTOR2 getMouseMovement();
	bool isKeyPressed(int key);
	void update();
	static DiManager* getInstance(void)
	{
		if(!instance)
			instance = new DiManager();
		return instance;
	}
	static void releaseDiManager()
	{
		delete(instance);
		instance = NULL;
	}
	~DiManager(void);

};