nCine::Backends::LibretroInputManager class

Input manager exposing the RetroPad of the frontend as a standard mapped gamepad.

The frontend provides neither a mouse nor a keyboard, every port is reported as a connected gamepad instead, so that local splitscreen multiplayer works out of the box.

Base classes

class nCine::IInputManager
Interface for querying input state and dispatching input events.

Public static variables

static std::int32_t NumPads constexpr
Number of gamepads exposed to the engine.
static std::int32_t NumButtons constexpr
Number of buttons of a RetroPad.
static std::int32_t NumAxes constexpr
Number of axes of a RetroPad.

Constructors, destructors, conversion operators

LibretroInputManager()

Public functions

void connectJoystick()
Reports every port as a connected gamepad.
void processFrame()
Polls the frontend and turns the changes into engine input events.
auto mouseState() const -> const MouseState& override
Returns the current mouse state.
auto keyboardState() const -> const KeyboardState& override
Returns the current keyboard state.
auto isJoyPresent(int joyId) const -> bool override
Returns true if the specified joystick is connected.
auto joyName(int joyId) const -> const char* override
Returns the name of the specified joystick.
auto joyGuid(int joyId) const -> const JoystickGuid override
Returns the GUID of the specified joystick.
auto joyNumButtons(int joyId) const -> int override
Returns the number of buttons of the specified joystick.
auto joyNumHats(int joyId) const -> int override
Returns the number of hats of the specified joystick.
auto joyNumAxes(int joyId) const -> int override
Returns the number of axes of the specified joystick.
auto joystickState(int joyId) const -> const JoystickState& override
Returns the raw state of the specified joystick.
auto joystickRumble(int joyId, float lowFreqIntensity, float highFreqIntensity, uint32_t durationMs) -> bool override
Starts a low/high frequency rumble effect for the specified duration in milliseconds.
auto joystickRumbleTriggers(int joyId, float left, float right, uint32_t durationMs) -> bool override
Starts a left/right trigger rumble effect for the specified duration in milliseconds.
void setCursor(Cursor cursor) override
Sets the mouse cursor mode.