#pragma once
#include <dinput.h>

namespace Gos2 {

class User : public GosUser
{
	static float			s_MouseX;
	static float			s_MouseY;
	static int				s_MouseXDelta;
	static int				s_MouseYDelta;
	static WORD				s_Buttons;


	static IDirectInput8*	s_pDirectInput;
	static IDirectInputDevice8*	s_pGameDevice;
	static long			s_GameXVal;
	static long			s_GameYVal;
	static DWORD			s_GameButtons;



public:
	static void				Initialize(  HWND hWnd, HINSTANCE hInst );
	static bool	CALLBACK	DIEnumCallBack( LPDIDEVICEINSTANCE pDI, void *pRef );
	static BOOL CALLBACK	EnumJoysticksCallback( const DIDEVICEINSTANCE* pdidInstance,
                                     VOID* pContext );
	static void				GetStatus( DWORD *pButtons, long *pX, long *pY );
	static void				Poll();
	static void				Shutdown();


	static GosUser::KeyStatus		GetKeyStatus( int KeyIndex );
	static int				GetKey();
	static float			GetAxis( int Joystick, GosUser::JoystickAxis Axis );
	static bool				GetJoystickButtonStatus( int Joystick, int Button );
	static void				SetJoystickPolling( int Joystick, bool yesNo, float howOften=0.03333f );
	static void				GetJoystickInfo( int Joystick, GosUser::JoystickInfo *pInfo );
	static void				SetMouse( WORD Buttons, WORD X, WORD Y );
	static DWORD			CountJoysticks();
	static void				KeyboardFlush();
	static void				GetMouseInfo( float* pXPosition, float* pYPosition, int* pXDelta, int* pYDelta, int* pWheelDelta, DWORD* pButtonsPressed );

};

} using namespace Gos2;