📄 cinputdevice.h
字号:
// CMAIN LIB - APPLICATION AND DIRECT WRAPPER
//
// Written by Mauricio Teichmann Ritter
//
// Copyright (C) 2002, Brazil. All rights reserved.
//
//
// cInputDevice.h: interface for the cInputDevice class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_CINPUTDEVICE_H__00716BAA_8084_456C_91FB_03CCE67C3565__INCLUDED_)
#define AFX_CINPUTDEVICE_H__00716BAA_8084_456C_91FB_03CCE67C3565__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "cApplication.h"
class cInputDevice
{
private:
static int m_iRefCount;
protected:
static LPDIRECTINPUT8 m_lpDI;
public:
cInputDevice();
virtual ~cInputDevice();
BOOL Create()
{
HRESULT hRet;
if(!m_lpDI)
{
hRet = DirectInput8Create(GetMainApp()->GetInstHandle(), DIRECTINPUT_VERSION,
IID_IDirectInput8, (void**)&m_lpDI, NULL);
if FAILED(hRet)
{
// DirectInput not available
return FALSE;
}
}
m_iRefCount++;
return TRUE;
}
void Destroy()
{
m_iRefCount--;
if(m_iRefCount == 0)
{
if(m_lpDI != NULL){
m_lpDI->Release();
m_lpDI = NULL;
}
}
}
};
#endif // !defined(AFX_CINPUTDEVICE_H__00716BAA_8084_456C_91FB_03CCE67C3565__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -