diff options
author | Laszlo Agocs <laszlo.agocs@digia.com> | 2014-02-05 15:54:36 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@digia.com> | 2014-07-29 12:18:37 +0200 |
commit | 66ba21971b24942c7481eeb4a4ff156f54ea658a (patch) | |
tree | 15cd4c61a7c9966e9a2f2ce7732bf5dcf736daf9 /tests | |
parent | 49cde1b2c4cdc44d1efd5f2d34b58d6a4fda56c8 (diff) | |
download | qtmultimedia-66ba21971b24942c7481eeb4a4ff156f54ea658a.tar.gz |
Support dynamic opengl32 - ANGLE switching on Windows
Change-Id: I38532db3ab0ad4fcb8dbabd0cbb528f7d8e4ba06
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/unit/qpaintervideosurface/tst_qpaintervideosurface.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/tests/auto/unit/qpaintervideosurface/tst_qpaintervideosurface.cpp b/tests/auto/unit/qpaintervideosurface/tst_qpaintervideosurface.cpp index 183714567..1588ba245 100644 --- a/tests/auto/unit/qpaintervideosurface/tst_qpaintervideosurface.cpp +++ b/tests/auto/unit/qpaintervideosurface/tst_qpaintervideosurface.cpp @@ -50,6 +50,7 @@ #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) #include <QtOpenGL/qgl.h> #include <QtOpenGL/qglframebufferobject.h> +#include <QtGui/qopenglfunctions.h> #endif QT_USE_NAMESPACE @@ -100,12 +101,12 @@ public: : QAbstractVideoBuffer(GLTextureHandle) , m_textureId(0) { - glGenTextures(1, &m_textureId); + QOpenGLContext::currentContext()->functions()->glGenTextures(1, &m_textureId); } ~QtTestGLVideoBuffer() { - glDeleteTextures(1, &m_textureId); + QOpenGLContext::currentContext()->functions()->glDeleteTextures(1, &m_textureId); } GLuint textureId() const { return m_textureId; } @@ -1226,12 +1227,13 @@ void tst_QPainterVideoSurface::shaderPresentGLFrame() QtTestGLVideoBuffer *buffer = new QtTestGLVideoBuffer; - glBindTexture(GL_TEXTURE_2D, buffer->textureId()); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 2, 2, 0, GL_RGB, GL_UNSIGNED_BYTE, rgb32ImageData); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + QOpenGLFunctions *f = QOpenGLContext::currentContext()->functions(); + f->glBindTexture(GL_TEXTURE_2D, buffer->textureId()); + f->glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 2, 2, 0, GL_RGB, GL_UNSIGNED_BYTE, rgb32ImageData); + f->glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + f->glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + f->glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + f->glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); QVideoFrame frame(buffer, QSize(2, 2), QVideoFrame::Format_RGB32); |