improve opengl portability

This commit is contained in:
ccolin 2021-01-02 16:00:44 +01:00
parent 29a745a6ec
commit 934e6b2592
2 changed files with 3 additions and 3 deletions

View File

@ -7,7 +7,7 @@
OpenGLMesh::OpenGLMesh(QVector<float> verts, QOpenGLTexture *tex)
:tex(tex) {
OpenGLWidget::instance->makeCurrent();
QOpenGLFunctions_4_4_Core *glf = OpenGLWidget::instance;
QOpenGLExtraFunctions *glf = OpenGLWidget::instance;
nverts = verts.size() / 8;
glf->glGenVertexArrays(1, &vao);
glf->glBindVertexArray(vao);

View File

@ -5,7 +5,7 @@
#include <QOpenGLWidget>
#include <QMatrix4x4>
#include <QOpenGLFunctions_4_4_Core>
#include <QOpenGLExtraFunctions>
#include <QOpenGLShaderProgram>
#include <QOpenGLVertexArrayObject>
#include <QOpenGLBuffer>
@ -13,7 +13,7 @@
#define FOV 70
class OpenGLWidget : public QOpenGLWidget, public QOpenGLFunctions_4_4_Core {
class OpenGLWidget : public QOpenGLWidget, public QOpenGLExtraFunctions {
Q_OBJECT
QMatrix4x4 rot, rot_start, proj;