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 /src/qtmultimediaquicktools/qsgvideonode_rgb.cpp | |
parent | 49cde1b2c4cdc44d1efd5f2d34b58d6a4fda56c8 (diff) |
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 'src/qtmultimediaquicktools/qsgvideonode_rgb.cpp')
-rw-r--r-- | src/qtmultimediaquicktools/qsgvideonode_rgb.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/qtmultimediaquicktools/qsgvideonode_rgb.cpp b/src/qtmultimediaquicktools/qsgvideonode_rgb.cpp index ad01a08ae..5911cb19b 100644 --- a/src/qtmultimediaquicktools/qsgvideonode_rgb.cpp +++ b/src/qtmultimediaquicktools/qsgvideonode_rgb.cpp @@ -176,7 +176,7 @@ public: ~QSGVideoMaterial_RGB() { if (m_textureId) - glDeleteTextures(1, &m_textureId); + QOpenGLContext::currentContext()->functions()->glDeleteTextures(1, &m_textureId); } virtual QSGMaterialType *type() const { @@ -225,8 +225,8 @@ public: if (m_textureSize != textureSize) { if (!m_textureSize.isEmpty()) - glDeleteTextures(1, &m_textureId); - glGenTextures(1, &m_textureId); + functions->glDeleteTextures(1, &m_textureId); + functions->glGenTextures(1, &m_textureId); m_textureSize = textureSize; } @@ -239,28 +239,28 @@ public: } GLint previousAlignment; - glGetIntegerv(GL_UNPACK_ALIGNMENT, &previousAlignment); - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + functions->glGetIntegerv(GL_UNPACK_ALIGNMENT, &previousAlignment); + functions->glPixelStorei(GL_UNPACK_ALIGNMENT, 1); functions->glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, m_textureId); - glTexImage2D(GL_TEXTURE_2D, 0, dataFormat, - m_textureSize.width(), m_textureSize.height(), - 0, dataFormat, dataType, m_frame.bits()); + functions->glBindTexture(GL_TEXTURE_2D, m_textureId); + functions->glTexImage2D(GL_TEXTURE_2D, 0, dataFormat, + m_textureSize.width(), m_textureSize.height(), + 0, dataFormat, dataType, m_frame.bits()); - glPixelStorei(GL_UNPACK_ALIGNMENT, previousAlignment); + functions->glPixelStorei(GL_UNPACK_ALIGNMENT, previousAlignment); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + functions->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + functions->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + functions->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + functions->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); m_frame.unmap(); } m_frame = QVideoFrame(); } else { functions->glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, m_textureId); + functions->glBindTexture(GL_TEXTURE_2D, m_textureId); } } |