mirror of
https://github.com/rwengine/openrw.git
synced 2024-11-07 03:12:36 +01:00
RWViewer: Use OpenGL 3.3 Core to prevent crash
This commit is contained in:
parent
35efe62697
commit
05831bea95
@ -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)
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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*)));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user