mirror of
https://github.com/citra-emu/citra.git
synced 2025-07-01 12:10:20 +00:00
44 lines
838 B
C++
44 lines
838 B
C++
// Copyright 2015 Citra Emulator Project
|
|
// Licensed under GPLv2 or any later version
|
|
// Refer to the license.txt file included.
|
|
|
|
#pragma once
|
|
|
|
#include <SDL2/SDL.h>
|
|
#include <iostream>
|
|
#include "input_common/input_common.h"
|
|
|
|
namespace InputCommon {
|
|
|
|
class SDLController : virtual public ControllerBase {
|
|
public:
|
|
SDLController();
|
|
~SDLController();
|
|
|
|
///Initializes input via SDL2
|
|
bool Init();
|
|
|
|
///Grabs a list of devices supported by the backend
|
|
void DiscoverDevices();
|
|
|
|
///Grab and process input via SDL2
|
|
void Poll();
|
|
|
|
///Shuts down all joysticks opened by SDL2
|
|
void ShutDown();
|
|
|
|
///SDL event used for polling
|
|
SDL_Event input_event;
|
|
|
|
private:
|
|
std::string name;
|
|
SDL_Joystick* j_pad;
|
|
|
|
///Index of joystick, used for opening/closing a joystick
|
|
int index;
|
|
};
|
|
|
|
} //namespace
|
|
|
|
|