HID system skeleton.
This commit is contained in:
10
src/xenia/hid/xinput/sources.gypi
Normal file
10
src/xenia/hid/xinput/sources.gypi
Normal 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',
|
||||
],
|
||||
}
|
||||
31
src/xenia/hid/xinput/xinput_hid-private.h
Normal file
31
src/xenia/hid/xinput/xinput_hid-private.h
Normal 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_
|
||||
44
src/xenia/hid/xinput/xinput_hid.cc
Normal file
44
src/xenia/hid/xinput/xinput_hid.cc
Normal 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);
|
||||
}
|
||||
33
src/xenia/hid/xinput/xinput_hid.h
Normal file
33
src/xenia/hid/xinput/xinput_hid.h
Normal 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_
|
||||
29
src/xenia/hid/xinput/xinput_input_driver.cc
Normal file
29
src/xenia/hid/xinput/xinput_input_driver.cc
Normal 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;
|
||||
}
|
||||
40
src/xenia/hid/xinput/xinput_input_driver.h
Normal file
40
src/xenia/hid/xinput/xinput_input_driver.h
Normal 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_
|
||||
Reference in New Issue
Block a user