all repos — mgba @ ca128a97ea23221aa5bb62f343be12848f307e5b

mGBA Game Boy Advance Emulator

Make Display take a QGLFormat
Jeffrey Pfau jeffrey@endrift.com
Wed, 15 Oct 2014 04:48:59 -0700
commit

ca128a97ea23221aa5bb62f343be12848f307e5b

parent

ddd8c8db29a1a7418626ade2ea35d432825579f3

3 files changed, 7 insertions(+), 4 deletions(-)

jump to
M src/platform/qt/Display.cppsrc/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.hsrc/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.cppsrc/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()));