Produce unimplemented warning for QOpenGLBuffer::map only once
authorAlex Wilson <alex.wilson@nokia.com>
Tue, 14 Feb 2012 03:25:26 +0000 (13:25 +1000)
committerQt by Nokia <qt-info@nokia.com>
Wed, 15 Feb 2012 01:35:37 +0000 (02:35 +0100)
Change-Id: Ia4f136e964e4e0ca326f462b0996ef3d1b843cf6
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
src/gui/opengl/qopenglbuffer.cpp

index e0ab98d..e6879a9 100644 (file)
@@ -529,7 +529,11 @@ void *QOpenGLBuffer::map(QOpenGLBuffer::Access access)
     return glMapBufferARB(d->type, access);
 #endif
     Q_UNUSED(access);
-    qWarning("QOpenGLBuffer::map(): pending implementation");
+    static bool warned = false;
+    if (!warned) {
+        qWarning("QOpenGLBuffer::map(): pending implementation");
+        warned = true;
+    }
     return 0;
 }
 
@@ -560,7 +564,11 @@ bool QOpenGLBuffer::unmap()
         return false;
     return glUnmapBufferARB(d->type) == GL_TRUE;
 #endif
-    qWarning("QOpenGLBuffer::map(): pending implementation");
+    static bool warned = false;
+    if (!warned) {
+        qWarning("QOpenGLBuffer::map(): pending implementation");
+        warned = true;
+    }
     return 0;
 }