Make Display take a QGLFormat

This commit is contained in:
Jeffrey Pfau 2014-10-15 04:48:59 -07:00
parent ddd8c8db29
commit ca128a97ea
3 changed files with 7 additions and 4 deletions

View File

@ -23,8 +23,8 @@ static const GLint _glTexCoords[] = {
0, 1
};
Display::Display(QWidget* parent)
: QGLWidget(QGLFormat(QGL::Rgba | QGL::SingleBuffer), parent)
Display::Display(QGLFormat format, QWidget* parent)
: QGLWidget(format, parent)
, m_painter(nullptr)
, m_drawThread(nullptr)
{

View File

@ -14,7 +14,7 @@ class Display : public QGLWidget {
Q_OBJECT
public:
Display(QWidget* parent = nullptr);
Display(QGLFormat format, QWidget* parent = nullptr);
public slots:
void startDrawing(const uint32_t* buffer, GBAThread* context);

View File

@ -24,7 +24,10 @@ Window::Window(QWidget* parent)
m_controller = new GameController(this);
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);
connect(m_controller, SIGNAL(gameStarted(GBAThread*)), this, SLOT(gameStarted(GBAThread*)));
connect(m_controller, SIGNAL(gameStopped(GBAThread*)), m_display, SLOT(stopDrawing()));