Sets OGL version for Qt; will only work with Qt5
This commit is contained in:
parent
c1b770cc0d
commit
3dad4e3b5c
|
@ -73,11 +73,10 @@ void EmuThread::Stop()
|
||||||
class GGLWidgetInternal : public QGLWidget
|
class GGLWidgetInternal : public QGLWidget
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GGLWidgetInternal(GRenderWindow* parent) : QGLWidget(parent)
|
GGLWidgetInternal(QGLFormat fmt, GRenderWindow* parent) : QGLWidget(parent)
|
||||||
{
|
{
|
||||||
setAutoBufferSwap(false);
|
doneCurrent();
|
||||||
doneCurrent();
|
parent_ = parent;
|
||||||
parent_ = parent;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void paintEvent(QPaintEvent* ev)
|
void paintEvent(QPaintEvent* ev)
|
||||||
|
@ -103,8 +102,13 @@ EmuThread& GRenderWindow::GetEmuThread()
|
||||||
GRenderWindow::GRenderWindow(QWidget* parent) : QWidget(parent), emu_thread(this)
|
GRenderWindow::GRenderWindow(QWidget* parent) : QWidget(parent), emu_thread(this)
|
||||||
{
|
{
|
||||||
// TODO: One of these flags might be interesting: WA_OpaquePaintEvent, WA_NoBackground, WA_DontShowOnScreen, WA_DeleteOnClose
|
// TODO: One of these flags might be interesting: WA_OpaquePaintEvent, WA_NoBackground, WA_DontShowOnScreen, WA_DeleteOnClose
|
||||||
|
QGLFormat fmt;
|
||||||
child = new GGLWidgetInternal(this);
|
fmt.setProfile(QGLFormat::CoreProfile);
|
||||||
|
fmt.setVersion(4,1);
|
||||||
|
fmt.setSampleBuffers(true);
|
||||||
|
fmt.setSamples(4);
|
||||||
|
|
||||||
|
child = new GGLWidgetInternal(fmt, this);
|
||||||
QBoxLayout* layout = new QHBoxLayout(this);
|
QBoxLayout* layout = new QHBoxLayout(this);
|
||||||
resize(VideoCore::kScreenTopWidth, VideoCore::kScreenTopHeight + VideoCore::kScreenBottomHeight);
|
resize(VideoCore::kScreenTopWidth, VideoCore::kScreenTopHeight + VideoCore::kScreenBottomHeight);
|
||||||
layout->addWidget(child);
|
layout->addWidget(child);
|
||||||
|
|
Reference in New Issue