Make Display take a QGLFormat
Jeffrey Pfau jeffrey@endrift.com
Wed, 15 Oct 2014 04:48:59 -0700
3 files changed,
7 insertions(+),
4 deletions(-)
M
src/platform/qt/Display.cpp
→
src/platform/qt/Display.cpp
@@ -23,8 +23,8 @@ 1, 1,
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) {
M
src/platform/qt/Display.h
→
src/platform/qt/Display.h
@@ -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);
M
src/platform/qt/Window.cpp
→
src/platform/qt/Window.cpp
@@ -24,7 +24,10 @@ setMinimumSize(240, 160);
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()));