mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-08 23:07:31 +00:00
![Xele02](/assets/img/avatar_default.png)
Add hack for X11 user which can have a crash when opening the first dialog and Gl is drawing. Remove the "open file" dialog automatic display on startup, very annoying.
78 lines
993 B
C++
78 lines
993 B
C++
#include "qtemugl.h"
|
|
|
|
QtEmuGL::QtEmuGL(QWidget *parent) :
|
|
QGLWidget(parent),
|
|
running_(false),
|
|
thread()
|
|
{
|
|
setAutoBufferSwap(false);
|
|
}
|
|
|
|
void QtEmuGL::init(InputState *inputState)
|
|
{
|
|
thread.init(inputState);
|
|
}
|
|
|
|
void QtEmuGL::SetRunning(bool value)
|
|
{
|
|
running_ = value;
|
|
}
|
|
|
|
void QtEmuGL::initializeGL()
|
|
{
|
|
}
|
|
void QtEmuGL::paintGL()
|
|
{
|
|
update();
|
|
}
|
|
|
|
void QtEmuGL::start_rendering()
|
|
{
|
|
thread.start();
|
|
}
|
|
|
|
void QtEmuGL::stop_rendering()
|
|
{
|
|
thread.setRunning(false);
|
|
thread.wait();
|
|
thread.Shutdown();
|
|
}
|
|
|
|
void QtEmuGL::start_game(QString filename)
|
|
{
|
|
thread.startGame(filename);
|
|
}
|
|
|
|
void QtEmuGL::stop_game()
|
|
{
|
|
thread.stopGame();
|
|
}
|
|
|
|
void QtEmuGL::LockDraw(bool value)
|
|
{
|
|
if(value)
|
|
{
|
|
thread.gameMutex.lock();
|
|
}
|
|
else
|
|
{
|
|
thread.gameMutex.unlock();
|
|
}
|
|
}
|
|
|
|
void QtEmuGL::resizeEvent(QResizeEvent *evt)
|
|
{
|
|
// TODO
|
|
//glt.resizeViewport(evt->size());
|
|
}
|
|
|
|
void QtEmuGL::paintEvent(QPaintEvent *)
|
|
{
|
|
}
|
|
|
|
void QtEmuGL::closeEvent(QCloseEvent *evt)
|
|
{
|
|
//TODO stopRendering();
|
|
QGLWidget::closeEvent(evt);
|
|
}
|