bsnes/ruby/input/quartz.cpp
Tim Allen 5d135b556d Update to v106r53 release.
byuu says:

Okay, so the WIPs-within-WIPs thing wasn't achieving its desired effect,
and it ended up causing me to have to redo some work on hiro since my
last local snapshot was of r52. So, heck it. I'll just do mostly
non-functional WIPs for a bit, and worry about the fallout years later
when I'm trying to find an emulation regression and cursing that the
WIPs aren't compiling.

I ported all of the ruby input drivers to the new syntax, as well as the
OpenAL driver. If you patch the ruby drivers for Linux with this in
mind, bsnes should compile and run there again.

Also, the bsnes program icon has returned, now that the new hiro layout
code is mature enough and I can simply add and remove the icon as a
Canvas instead of having to try and render into a viewport. The icon
shows up instantly with the main window.
2018-08-01 19:07:28 +10:00

44 lines
1.0 KiB
C++

#include "keyboard/quartz.cpp"
struct InputQuartz : InputDriver {
InputQuartz(Input& super) : InputDriver(super), keyboard(super) {}
~InputQuartz() { terminate(); }
auto create() -> bool override {
return initialize();
}
auto driver() -> string override { return "Quartz"; }
auto ready() -> bool override { return isReady; }
auto acquired() -> bool override { return false; }
auto acquire() -> bool override { return false; }
auto release() -> bool override { return false; }
auto poll() -> vector<shared_pointer<HID::Device>> override {
vector<shared_pointer<HID::Device>> devices;
keyboard.poll(devices);
return devices;
}
auto rumble(uint64_t id, bool enable) -> bool override {
return false;
}
private:
auto initialize() -> bool {
terminate();
if(!keyboard.initialize()) return false;
return _ready = true;
}
auto terminate() -> void {
isReady = false;
keyboard.terminate();
}
InputQuartz& self = *this;
bool isReady = false;
InputKeyboardQuartz keyboard;
};