mirror of https://github.com/mgba-emu/mgba.git
Make Display take a QGLFormat
This commit is contained in:
parent
ddd8c8db29
commit
ca128a97ea
|
@ -23,8 +23,8 @@ static const GLint _glTexCoords[] = {
|
||||||
0, 1
|
0, 1
|
||||||
};
|
};
|
||||||
|
|
||||||
Display::Display(QWidget* parent)
|
Display::Display(QGLFormat format, QWidget* parent)
|
||||||
: QGLWidget(QGLFormat(QGL::Rgba | QGL::SingleBuffer), parent)
|
: QGLWidget(format, parent)
|
||||||
, m_painter(nullptr)
|
, m_painter(nullptr)
|
||||||
, m_drawThread(nullptr)
|
, m_drawThread(nullptr)
|
||||||
{
|
{
|
||||||
|
|
|
@ -14,7 +14,7 @@ class Display : public QGLWidget {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Display(QWidget* parent = nullptr);
|
Display(QGLFormat format, QWidget* parent = nullptr);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void startDrawing(const uint32_t* buffer, GBAThread* context);
|
void startDrawing(const uint32_t* buffer, GBAThread* context);
|
||||||
|
|
|
@ -24,7 +24,10 @@ Window::Window(QWidget* parent)
|
||||||
|
|
||||||
m_controller = new GameController(this);
|
m_controller = new GameController(this);
|
||||||
m_logView = new LogView();
|
m_logView = new LogView();
|
||||||
m_display = new Display();
|
|
||||||
|
QGLFormat format(QGLFormat(QGL::Rgba | QGL::DoubleBuffer));
|
||||||
|
format.setSwapInterval(1);
|
||||||
|
m_display = new Display(format);
|
||||||
setCentralWidget(m_display);
|
setCentralWidget(m_display);
|
||||||
connect(m_controller, SIGNAL(gameStarted(GBAThread*)), this, SLOT(gameStarted(GBAThread*)));
|
connect(m_controller, SIGNAL(gameStarted(GBAThread*)), this, SLOT(gameStarted(GBAThread*)));
|
||||||
connect(m_controller, SIGNAL(gameStopped(GBAThread*)), m_display, SLOT(stopDrawing()));
|
connect(m_controller, SIGNAL(gameStopped(GBAThread*)), m_display, SLOT(stopDrawing()));
|
||||||
|
|
Loading…
Reference in New Issue