/// ****************************************************************************
/// @file   
/// @author Dr.Neeton
/// @date   200X/X/X - 2014/01/26
/// 
/// @brief  DirectX、DiretInput関係。
/// 
/// ****************************************************************************

#pragma once

#ifndef DIRECTINPUT_VERSION
#define DIRECTINPUT_VERSION 0x800
#endif


#ifndef NOMINMAX
#define NOMINMAX // min/max定義すんな！
#endif


#include "CPL_DX_Kernel.h"

#include <dinput.h>



namespace CPL {
namespace DX {


// _____________________________________________________________________________
/// @brief DirectInput 管理クラス
///
// *****************************************************************************
class Input {
protected:
  LPDIRECTINPUT8       m_ptr_dinput;
  LPDIRECTINPUTDEVICE8 m_ptr_key_device;
  LPDIRECTINPUTDEVICE8 m_ptr_mouse_device;

public:
  HRESULT CreateInput();
  HRESULT CreateKeyDevice  ( _in<HWND> in_hdl_window );
  HRESULT CreateMouseDevice( _in<HWND> in_hdl_window );

  void    KeyRead( BYTE out_key_table[256] );
  void    MouseRead( DIMOUSESTATE2* out_mouse_state );

  Input();
  ~Input();
};


} // namespace DX
} // namespace CPL
