mirror of https://github.com/mgba-emu/mgba.git
Qt: Attempt to reduce flickering
This commit is contained in:
parent
903f792731
commit
ff772fce9d
|
@ -55,6 +55,14 @@ uint qHash(const QSurfaceFormat& format, uint seed) {
|
||||||
return qHash(representation, seed);
|
return qHash(representation, seed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mGLWidget::mGLWidget(QWidget* parent)
|
||||||
|
: QOpenGLWidget(parent)
|
||||||
|
{
|
||||||
|
setUpdateBehavior(QOpenGLWidget::PartialUpdate);
|
||||||
|
|
||||||
|
connect(&m_refresh, &QTimer::timeout, this, static_cast<void (QWidget::*)()>(&QWidget::update));
|
||||||
|
}
|
||||||
|
|
||||||
void mGLWidget::initializeGL() {
|
void mGLWidget::initializeGL() {
|
||||||
m_vao = std::make_unique<QOpenGLVertexArrayObject>();
|
m_vao = std::make_unique<QOpenGLVertexArrayObject>();
|
||||||
m_vao->create();
|
m_vao->create();
|
||||||
|
@ -84,8 +92,6 @@ void mGLWidget::initializeGL() {
|
||||||
|
|
||||||
m_vaoDone = false;
|
m_vaoDone = false;
|
||||||
m_tex = 0;
|
m_tex = 0;
|
||||||
|
|
||||||
connect(&m_refresh, &QTimer::timeout, this, static_cast<void (QWidget::*)()>(&QWidget::update));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool mGLWidget::finalizeVAO() {
|
bool mGLWidget::finalizeVAO() {
|
||||||
|
|
|
@ -50,6 +50,8 @@ class mGLWidget : public QOpenGLWidget {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
mGLWidget(QWidget* parent = nullptr);
|
||||||
|
|
||||||
void setTex(GLuint tex) { m_tex = tex; }
|
void setTex(GLuint tex) { m_tex = tex; }
|
||||||
void setVBO(GLuint vbo) { m_vbo = vbo; }
|
void setVBO(GLuint vbo) { m_vbo = vbo; }
|
||||||
bool finalizeVAO();
|
bool finalizeVAO();
|
||||||
|
|
Loading…
Reference in New Issue