mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-20 01:57:52 -05:00
input_common: Eliminate most global state
Abstracts most of the input mechanisms under an InputSubsystem class that is managed by the frontends, eliminating any static constructors and destructors. This gets rid of global accessor functions and also allows the frontends to have a more fine-grained control over the lifecycle of the input subsystem. This also makes it explicit which interfaces rely on the input subsystem instead of making it opaque in the interface functions. All that remains to migrate over is the factories, which can be done in a separate change.
This commit is contained in:
@ -23,6 +23,10 @@ class QKeyEvent;
|
||||
class QTouchEvent;
|
||||
class QStringList;
|
||||
|
||||
namespace InputCommon {
|
||||
class InputSubsystem;
|
||||
}
|
||||
|
||||
namespace VideoCore {
|
||||
enum class LoadCallbackStage;
|
||||
}
|
||||
@ -121,7 +125,8 @@ class GRenderWindow : public QWidget, public Core::Frontend::EmuWindow {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GRenderWindow(GMainWindow* parent, EmuThread* emu_thread);
|
||||
explicit GRenderWindow(GMainWindow* parent, EmuThread* emu_thread_,
|
||||
InputCommon::InputSubsystem* input_subsystem_);
|
||||
~GRenderWindow() override;
|
||||
|
||||
// EmuWindow implementation.
|
||||
@ -183,6 +188,7 @@ private:
|
||||
QStringList GetUnsupportedGLExtensions() const;
|
||||
|
||||
EmuThread* emu_thread;
|
||||
InputCommon::InputSubsystem* input_subsystem;
|
||||
|
||||
// Main context that will be shared with all other contexts that are requested.
|
||||
// If this is used in a shared context setting, then this should not be used directly, but
|
||||
|
Reference in New Issue
Block a user