Extend QOpenGLVertexArrayObjectHelper to support glIsVertexArrays
This is needed for dynamicgl support in QtWebKit. Change-Id: I4d1769394ccdeaf449cac4f002c03ca8013f62f6 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
This commit is contained in:
parent
be1635e2d6
commit
56f3eb299c
@ -61,6 +61,7 @@ void qtInitializeVertexArrayObjectHelper(QOpenGLVertexArrayObjectHelper *helper,
|
|||||||
helper->GenVertexArrays = ::glGenVertexArrays;
|
helper->GenVertexArrays = ::glGenVertexArrays;
|
||||||
helper->DeleteVertexArrays = ::glDeleteVertexArrays;
|
helper->DeleteVertexArrays = ::glDeleteVertexArrays;
|
||||||
helper->BindVertexArray = ::glBindVertexArray;
|
helper->BindVertexArray = ::glBindVertexArray;
|
||||||
|
helper->IsVertexArray = ::glIsVertexArray;
|
||||||
tryARB = false;
|
tryARB = false;
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
@ -68,6 +69,7 @@ void qtInitializeVertexArrayObjectHelper(QOpenGLVertexArrayObjectHelper *helper,
|
|||||||
helper->GenVertexArrays = reinterpret_cast<QOpenGLVertexArrayObjectHelper::qt_GenVertexArrays_t>(context->getProcAddress(QByteArrayLiteral("glGenVertexArraysOES")));
|
helper->GenVertexArrays = reinterpret_cast<QOpenGLVertexArrayObjectHelper::qt_GenVertexArrays_t>(context->getProcAddress(QByteArrayLiteral("glGenVertexArraysOES")));
|
||||||
helper->DeleteVertexArrays = reinterpret_cast<QOpenGLVertexArrayObjectHelper::qt_DeleteVertexArrays_t>(context->getProcAddress(QByteArrayLiteral("glDeleteVertexArraysOES")));
|
helper->DeleteVertexArrays = reinterpret_cast<QOpenGLVertexArrayObjectHelper::qt_DeleteVertexArrays_t>(context->getProcAddress(QByteArrayLiteral("glDeleteVertexArraysOES")));
|
||||||
helper->BindVertexArray = reinterpret_cast<QOpenGLVertexArrayObjectHelper::qt_BindVertexArray_t>(context->getProcAddress(QByteArrayLiteral("glBindVertexArrayOES")));
|
helper->BindVertexArray = reinterpret_cast<QOpenGLVertexArrayObjectHelper::qt_BindVertexArray_t>(context->getProcAddress(QByteArrayLiteral("glBindVertexArrayOES")));
|
||||||
|
helper->IsVertexArray = reinterpret_cast<QOpenGLVertexArrayObjectHelper::qt_IsVertexArray_t>(context->getProcAddress(QByteArrayLiteral("glIsVertexArrayOES")));
|
||||||
tryARB = false;
|
tryARB = false;
|
||||||
}
|
}
|
||||||
} else if (context->hasExtension(QByteArrayLiteral("GL_APPLE_vertex_array_object")) &&
|
} else if (context->hasExtension(QByteArrayLiteral("GL_APPLE_vertex_array_object")) &&
|
||||||
@ -75,6 +77,7 @@ void qtInitializeVertexArrayObjectHelper(QOpenGLVertexArrayObjectHelper *helper,
|
|||||||
helper->GenVertexArrays = reinterpret_cast<QOpenGLVertexArrayObjectHelper::qt_GenVertexArrays_t>(context->getProcAddress(QByteArrayLiteral("glGenVertexArraysAPPLE")));
|
helper->GenVertexArrays = reinterpret_cast<QOpenGLVertexArrayObjectHelper::qt_GenVertexArrays_t>(context->getProcAddress(QByteArrayLiteral("glGenVertexArraysAPPLE")));
|
||||||
helper->DeleteVertexArrays = reinterpret_cast<QOpenGLVertexArrayObjectHelper::qt_DeleteVertexArrays_t>(context->getProcAddress(QByteArrayLiteral("glDeleteVertexArraysAPPLE")));
|
helper->DeleteVertexArrays = reinterpret_cast<QOpenGLVertexArrayObjectHelper::qt_DeleteVertexArrays_t>(context->getProcAddress(QByteArrayLiteral("glDeleteVertexArraysAPPLE")));
|
||||||
helper->BindVertexArray = reinterpret_cast<QOpenGLVertexArrayObjectHelper::qt_BindVertexArray_t>(context->getProcAddress(QByteArrayLiteral("glBindVertexArrayAPPLE")));
|
helper->BindVertexArray = reinterpret_cast<QOpenGLVertexArrayObjectHelper::qt_BindVertexArray_t>(context->getProcAddress(QByteArrayLiteral("glBindVertexArrayAPPLE")));
|
||||||
|
helper->IsVertexArray = reinterpret_cast<QOpenGLVertexArrayObjectHelper::qt_IsVertexArray_t>(context->getProcAddress(QByteArrayLiteral("glIsVertexArrayAPPLE")));
|
||||||
tryARB = false;
|
tryARB = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,6 +85,7 @@ void qtInitializeVertexArrayObjectHelper(QOpenGLVertexArrayObjectHelper *helper,
|
|||||||
helper->GenVertexArrays = reinterpret_cast<QOpenGLVertexArrayObjectHelper::qt_GenVertexArrays_t>(context->getProcAddress(QByteArrayLiteral("glGenVertexArrays")));
|
helper->GenVertexArrays = reinterpret_cast<QOpenGLVertexArrayObjectHelper::qt_GenVertexArrays_t>(context->getProcAddress(QByteArrayLiteral("glGenVertexArrays")));
|
||||||
helper->DeleteVertexArrays = reinterpret_cast<QOpenGLVertexArrayObjectHelper::qt_DeleteVertexArrays_t>(context->getProcAddress(QByteArrayLiteral("glDeleteVertexArrays")));
|
helper->DeleteVertexArrays = reinterpret_cast<QOpenGLVertexArrayObjectHelper::qt_DeleteVertexArrays_t>(context->getProcAddress(QByteArrayLiteral("glDeleteVertexArrays")));
|
||||||
helper->BindVertexArray = reinterpret_cast<QOpenGLVertexArrayObjectHelper::qt_BindVertexArray_t>(context->getProcAddress(QByteArrayLiteral("glBindVertexArray")));
|
helper->BindVertexArray = reinterpret_cast<QOpenGLVertexArrayObjectHelper::qt_BindVertexArray_t>(context->getProcAddress(QByteArrayLiteral("glBindVertexArray")));
|
||||||
|
helper->IsVertexArray = reinterpret_cast<QOpenGLVertexArrayObjectHelper::qt_IsVertexArray_t>(context->getProcAddress(QByteArrayLiteral("glIsVertexArray")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,13 +67,14 @@ public:
|
|||||||
: GenVertexArrays(Q_NULLPTR)
|
: GenVertexArrays(Q_NULLPTR)
|
||||||
, DeleteVertexArrays(Q_NULLPTR)
|
, DeleteVertexArrays(Q_NULLPTR)
|
||||||
, BindVertexArray(Q_NULLPTR)
|
, BindVertexArray(Q_NULLPTR)
|
||||||
|
, IsVertexArray(Q_NULLPTR)
|
||||||
{
|
{
|
||||||
qtInitializeVertexArrayObjectHelper(this, context);
|
qtInitializeVertexArrayObjectHelper(this, context);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool isValid() const
|
inline bool isValid() const
|
||||||
{
|
{
|
||||||
return GenVertexArrays && DeleteVertexArrays && BindVertexArray;
|
return GenVertexArrays && DeleteVertexArrays && BindVertexArray && IsVertexArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void glGenVertexArrays(GLsizei n, GLuint *arrays) const
|
inline void glGenVertexArrays(GLsizei n, GLuint *arrays) const
|
||||||
@ -91,6 +92,11 @@ public:
|
|||||||
BindVertexArray(array);
|
BindVertexArray(array);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline GLboolean glIsVertexArray(GLuint array) const
|
||||||
|
{
|
||||||
|
return IsVertexArray(array);
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend void Q_GUI_EXPORT qtInitializeVertexArrayObjectHelper(QOpenGLVertexArrayObjectHelper *helper, QOpenGLContext *context);
|
friend void Q_GUI_EXPORT qtInitializeVertexArrayObjectHelper(QOpenGLVertexArrayObjectHelper *helper, QOpenGLContext *context);
|
||||||
|
|
||||||
@ -98,10 +104,12 @@ private:
|
|||||||
typedef void (QOPENGLF_APIENTRYP qt_GenVertexArrays_t)(GLsizei n, GLuint *arrays);
|
typedef void (QOPENGLF_APIENTRYP qt_GenVertexArrays_t)(GLsizei n, GLuint *arrays);
|
||||||
typedef void (QOPENGLF_APIENTRYP qt_DeleteVertexArrays_t)(GLsizei n, const GLuint *arrays);
|
typedef void (QOPENGLF_APIENTRYP qt_DeleteVertexArrays_t)(GLsizei n, const GLuint *arrays);
|
||||||
typedef void (QOPENGLF_APIENTRYP qt_BindVertexArray_t)(GLuint array);
|
typedef void (QOPENGLF_APIENTRYP qt_BindVertexArray_t)(GLuint array);
|
||||||
|
typedef GLboolean (QOPENGLF_APIENTRYP qt_IsVertexArray_t)(GLuint array);
|
||||||
|
|
||||||
qt_GenVertexArrays_t GenVertexArrays;
|
qt_GenVertexArrays_t GenVertexArrays;
|
||||||
qt_DeleteVertexArrays_t DeleteVertexArrays;
|
qt_DeleteVertexArrays_t DeleteVertexArrays;
|
||||||
qt_BindVertexArray_t BindVertexArray;
|
qt_BindVertexArray_t BindVertexArray;
|
||||||
|
qt_IsVertexArray_t IsVertexArray;
|
||||||
};
|
};
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
Loading…
Reference in New Issue
Block a user