mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 20:42:21 +02:00
DirectInput support
This commit is contained in:
parent
b9f84d328e
commit
98c35f4a87
6 changed files with 64 additions and 1 deletions
|
@ -4,6 +4,7 @@
|
|||
#include <signal.h>
|
||||
#include "../../util/BeefPerf.h"
|
||||
#include "DSoundManager.h"
|
||||
#include "DInputManager.h"
|
||||
|
||||
#include <dwmapi.h>
|
||||
#pragma comment(lib, "dwmapi.lib")
|
||||
|
@ -1137,12 +1138,14 @@ WinBFApp::WinBFApp()
|
|||
mDataDir = mInstallDir;
|
||||
mInMsgProc = false;
|
||||
mDSoundManager = NULL;
|
||||
mDInputManager = NULL;
|
||||
}
|
||||
|
||||
WinBFApp::~WinBFApp()
|
||||
{
|
||||
delete mRenderDevice;
|
||||
delete mDSoundManager;
|
||||
delete mDInputManager;
|
||||
}
|
||||
|
||||
void WinBFApp::Init()
|
||||
|
@ -1269,6 +1272,20 @@ void WinBFApp::RehupMouse()
|
|||
}
|
||||
}
|
||||
|
||||
String WinBFApp::EnumerateInputDevices()
|
||||
{
|
||||
if (mDInputManager == NULL)
|
||||
mDInputManager = new DInputManager();
|
||||
return mDInputManager->EnumerateDevices();
|
||||
}
|
||||
|
||||
BFInputDevice* WinBFApp::CreateInputDevice(const StringImpl& guid)
|
||||
{
|
||||
if (mDInputManager == NULL)
|
||||
mDInputManager = new DInputManager();
|
||||
return mDInputManager->CreateInputDevice(guid);
|
||||
}
|
||||
|
||||
void WinBFWindow::SetMinimumSize(int minWidth, int minHeight, bool clientSized)
|
||||
{
|
||||
if (clientSized)
|
||||
|
|
|
@ -10,6 +10,7 @@ NS_BF_BEGIN;
|
|||
|
||||
class RenderDevice;
|
||||
class DSoundManager;
|
||||
class DInputManager;
|
||||
|
||||
typedef Dictionary<void*, HGLOBAL> PtrToHGlobalMap;
|
||||
typedef Dictionary<String, uint32> StringToUIntMap;
|
||||
|
@ -90,6 +91,7 @@ public:
|
|||
bool mInMsgProc;
|
||||
StringToUIntMap mClipboardFormatMap;
|
||||
DSoundManager* mDSoundManager;
|
||||
DInputManager* mDInputManager;
|
||||
|
||||
protected:
|
||||
virtual void Draw() override;
|
||||
|
@ -115,6 +117,9 @@ public:
|
|||
virtual void SetClipboardData(const StringImpl& format, const void* ptr, int size, bool resetClipboard) override;
|
||||
virtual void RehupMouse() override;
|
||||
|
||||
virtual String EnumerateInputDevices() override;
|
||||
virtual BFInputDevice* CreateInputDevice(const StringImpl& guid) override;
|
||||
|
||||
virtual BFSysBitmap* LoadSysBitmap(const WCHAR* fileName) override;
|
||||
|
||||
virtual BFSoundManager* GetSoundManager() override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue