1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-25 20:02:40 +01:00

RWViewer: Use OpenGL 3.3 Core to prevent crash

This commit is contained in:
Jannik Vogel 2016-08-08 06:30:11 +02:00
parent 35efe62697
commit 05831bea95
3 changed files with 9 additions and 4 deletions

View File

@ -15,8 +15,8 @@
#include <objects/VehicleObject.hpp>
ViewerWidget::ViewerWidget(QWidget* parent, const QGLWidget* shareWidget, Qt::WindowFlags f)
: QGLWidget(parent, shareWidget, f)
ViewerWidget::ViewerWidget(QGLFormat g, QWidget* parent, const QGLWidget* shareWidget, Qt::WindowFlags f)
: QGLWidget(g, parent, shareWidget, f)
, gworld(nullptr)
, activeModel(nullptr)
, selectedFrame(nullptr)

View File

@ -52,7 +52,7 @@ class ViewerWidget : public QGLWidget
void drawFrameWidget(ModelFrame* f, const glm::mat4& = glm::mat4(1.f));
public:
ViewerWidget(QWidget* parent = 0, const QGLWidget* shareWidget = 0, Qt::WindowFlags f = 0);
ViewerWidget(QGLFormat g, QWidget* parent = 0, const QGLWidget* shareWidget = 0, Qt::WindowFlags f = 0);
virtual void initializeGL();

View File

@ -46,7 +46,12 @@ ViewerWindow::ViewerWindow(QWidget* parent, Qt::WindowFlags flags)
connect(ex, SIGNAL(triggered()), QApplication::instance(), SLOT(closeAllWindows()));
//----------------------- View Mode setup
viewerWidget = new ViewerWidget;
QGLFormat glFormat;
glFormat.setVersion( 3, 3 );
glFormat.setProfile( QGLFormat::CoreProfile );
viewerWidget = new ViewerWidget(glFormat);
viewerWidget->context()->makeCurrent();
connect(this, SIGNAL(loadedData(GameWorld*)), viewerWidget, SLOT(dataLoaded(GameWorld*)));