2013-01-13 23:29:42 +00:00
|
|
|
#pragma once
|
|
|
|
#include <QThread>
|
2013-02-05 21:22:14 +00:00
|
|
|
#include <QMutex>
|
2013-01-13 23:29:42 +00:00
|
|
|
#include "input/input_state.h"
|
|
|
|
|
|
|
|
class QtEmuGL;
|
|
|
|
|
|
|
|
class EmuThread : public QThread
|
|
|
|
{
|
|
|
|
public:
|
2013-02-10 15:36:06 +00:00
|
|
|
EmuThread();
|
|
|
|
~EmuThread();
|
2013-01-15 16:16:07 +00:00
|
|
|
void init(InputState* inputState);
|
2013-01-13 23:29:42 +00:00
|
|
|
void run();
|
|
|
|
void FinalShutdown();
|
|
|
|
void setRunning(bool value);
|
2013-02-05 21:22:14 +00:00
|
|
|
void startGame(QString filename);
|
|
|
|
void stopGame();
|
2013-02-10 15:36:06 +00:00
|
|
|
void LockGL(bool value);
|
2013-01-13 23:29:42 +00:00
|
|
|
public slots:
|
|
|
|
void Shutdown();
|
|
|
|
private:
|
|
|
|
InputState* input_state;
|
|
|
|
bool running;
|
2013-02-05 21:22:14 +00:00
|
|
|
bool gameRunning;
|
|
|
|
bool needInitGame;
|
|
|
|
int frames_;
|
2013-02-10 15:36:06 +00:00
|
|
|
QMutex *gameMutex;
|
|
|
|
int mutexLockNum;
|
2013-02-05 21:22:14 +00:00
|
|
|
|
2013-01-13 23:29:42 +00:00
|
|
|
};
|
|
|
|
|
2013-02-05 21:22:14 +00:00
|
|
|
void EmuThread_Start(QtEmuGL* w);
|
2013-01-13 23:29:42 +00:00
|
|
|
void EmuThread_Stop();
|
2013-02-05 21:22:14 +00:00
|
|
|
void EmuThread_StartGame(QString filename);
|
|
|
|
void EmuThread_StopGame();
|
|
|
|
void EmuThread_LockDraw(bool value);
|
2013-02-10 15:36:06 +00:00
|
|
|
QString GetCurrentFilename();
|