Fixed QOpenGLFunctions API.
authorSamuel Rødal <samuel.rodal@nokia.com>
Tue, 12 Jun 2012 08:21:37 +0000 (10:21 +0200)
committerQt by Nokia <qt-info@nokia.com>
Mon, 18 Jun 2012 19:58:30 +0000 (21:58 +0200)
We don't use the GL short term in the new API.

Change-Id: I73a51f65f5f4216c1763b95dcddf68fe8fc229d1
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
src/gui/opengl/qopenglframebufferobject.cpp
src/gui/opengl/qopenglfunctions.cpp
src/gui/opengl/qopenglfunctions.h
src/gui/opengl/qopenglpaintengine.cpp
src/gui/opengl/qopenglshaderprogram.cpp

index ea75dd4..2fc45fd 100644 (file)
@@ -384,7 +384,7 @@ void QOpenGLFramebufferObjectPrivate::init(QOpenGLFramebufferObject *, const QSi
 {
     QOpenGLContext *ctx = QOpenGLContext::currentContext();
 
-    funcs.initializeGLFunctions();
+    funcs.initializeOpenGLFunctions();
 
     if (!funcs.hasOpenGLFeature(QOpenGLFunctions::Framebuffers))
         return;
index f19d473..3c77e92 100644 (file)
@@ -446,10 +446,10 @@ bool QOpenGLExtensions::hasOpenGLExtension(QOpenGLExtensions::OpenGLExtension ex
 
     After calling this function, the QOpenGLFunctions object can only be
     used with the current context and other contexts that share with it.
-    Call initializeGLFunctions() again to change the object's context
+    Call initializeOpenGLFunctions() again to change the object's context
     association.
 */
-void QOpenGLFunctions::initializeGLFunctions()
+void QOpenGLFunctions::initializeOpenGLFunctions()
 {
     d_ptr = qt_gl_functions();
 }
index 8702984..fc55a6b 100644 (file)
@@ -224,7 +224,11 @@ public:
     QOpenGLFunctions::OpenGLFeatures openGLFeatures() const;
     bool hasOpenGLFeature(QOpenGLFunctions::OpenGLFeature feature) const;
 
-    void initializeGLFunctions();
+    void initializeOpenGLFunctions();
+
+#if QT_DEPRECATED_SINCE(5, 0)
+    QT_DEPRECATED void initializeGLFunctions() { initializeOpenGLFunctions(); }
+#endif
 
     void glActiveTexture(GLenum texture);
     void glAttachShader(GLuint program, GLuint shader);
index 73be87b..138a11a 100644 (file)
@@ -1924,7 +1924,7 @@ bool QOpenGL2PaintEngineEx::begin(QPaintDevice *pdev)
     d->ctx = QOpenGLContext::currentContext();
     d->ctx->d_func()->active_engine = this;
 
-    d->funcs.initializeGLFunctions();
+    d->funcs.initializeOpenGLFunctions();
 
     for (int i = 0; i < QT_GL_VERTEX_ARRAY_TRACKED_COUNT; ++i)
         d->vertexAttributeArraysEnabledState[i] = false;
index e9973be..264a198 100644 (file)
@@ -594,7 +594,7 @@ bool QOpenGLShaderProgram::init()
     QOpenGLContext *context = const_cast<QOpenGLContext *>(QOpenGLContext::currentContext());
     if (!context)
         return false;
-    d->glfuncs->initializeGLFunctions();
+    d->glfuncs->initializeOpenGLFunctions();
     GLuint program = d->glfuncs->glCreateProgram();
     if (!program) {
         qWarning() << "QOpenGLShaderProgram: could not create shader program";