HID system skeleton.

This commit is contained in:
Ben Vanik
2013-10-23 21:47:36 -07:00
parent 20bd15e7fe
commit 74803ae174
25 changed files with 684 additions and 5 deletions

View File

@@ -0,0 +1,10 @@
# Copyright 2013 Ben Vanik. All Rights Reserved.
{
'sources': [
'xinput_hid-private.h',
'xinput_hid.cc',
'xinput_hid.h',
'xinput_input_driver.cc',
'xinput_input_driver.h',
],
}

View File

@@ -0,0 +1,31 @@
/**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2013 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#ifndef XENIA_HID_XINPUT_XINPUT_HID_PRIVATE_H_
#define XENIA_HID_XINPUT_XINPUT_HID_PRIVATE_H_
#include <xenia/core.h>
#include <xenia/hid/xinput/xinput_hid.h>
namespace xe {
namespace hid {
namespace xinput {
} // namespace xinput
} // namespace hid
} // namespace xe
#endif // XENIA_HID_XINPUT_XINPUT_HID_PRIVATE_H_

View File

@@ -0,0 +1,44 @@
/**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2013 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#include <xenia/hid/xinput/xinput_hid.h>
#include <xenia/hid/xinput/xinput_input_driver.h>
using namespace xe;
using namespace xe::hid;
using namespace xe::hid::xinput;
namespace {
void InitializeIfNeeded();
void CleanupOnShutdown();
void InitializeIfNeeded() {
static bool has_initialized = false;
if (has_initialized) {
return;
}
has_initialized = true;
//
atexit(CleanupOnShutdown);
}
void CleanupOnShutdown() {
}
}
InputDriver* xe::hid::xinput::Create(InputSystem* input_system) {
InitializeIfNeeded();
return new XInputInputDriver(input_system);
}

View File

@@ -0,0 +1,33 @@
/**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2013 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#ifndef XENIA_HID_XINPUT_XINPUT_HID_H_
#define XENIA_HID_XINPUT_XINPUT_HID_H_
#include <xenia/core.h>
XEDECLARECLASS2(xe, hid, InputDriver);
XEDECLARECLASS2(xe, hid, InputSystem);
namespace xe {
namespace hid {
namespace xinput {
InputDriver* Create(InputSystem* input_system);
} // namespace xinput
} // namespace hid
} // namespace xe
#endif // XENIA_HID_XINPUT_XINPUT_HID_H_

View File

@@ -0,0 +1,29 @@
/**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2013 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#include <xenia/hid/xinput/xinput_input_driver.h>
#include <xenia/hid/hid-private.h>
using namespace xe;
using namespace xe::hid;
using namespace xe::hid::xinput;
XInputInputDriver::XInputInputDriver(InputSystem* input_system) :
InputDriver(input_system) {
}
XInputInputDriver::~XInputInputDriver() {
}
X_STATUS XInputInputDriver::Setup() {
return X_STATUS_SUCCESS;
}

View File

@@ -0,0 +1,40 @@
/**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2013 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#ifndef XENIA_HID_XINPUT_XINPUT_DRIVER_H_
#define XENIA_HID_XINPUT_XINPUT_DRIVER_H_
#include <xenia/core.h>
#include <xenia/hid/input_driver.h>
#include <xenia/hid/nop/nop_hid-private.h>
namespace xe {
namespace hid {
namespace xinput {
class XInputInputDriver : public InputDriver {
public:
XInputInputDriver(InputSystem* input_system);
virtual ~XInputInputDriver();
virtual X_STATUS Setup();
protected:
};
} // namespace xinput
} // namespace hid
} // namespace xe
#endif // XENIA_HID_XINPUT_XINPUT_DRIVER_H_