summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
authorAaron McCarthy <aaron.mccarthy@nokia.com>2010-03-23 03:01:51 (GMT)
committerAaron McCarthy <aaron.mccarthy@nokia.com>2010-03-23 03:01:51 (GMT)
commite488b62271d89bb4056ad9b98903f8530917a4a0 (patch)
tree90f7e6d0ba3ff56c47e42848ae5eb33af45b135b /src/opengl
parent3fa7e7d082de97abfb50d28f25f22185deabd82d (diff)
parentf50f94512a22b311277ba07e09cf59e2c73bb25c (diff)
downloadQt-e488b62271d89bb4056ad9b98903f8530917a4a0.zip
Qt-e488b62271d89bb4056ad9b98903f8530917a4a0.tar.gz
Qt-e488b62271d89bb4056ad9b98903f8530917a4a0.tar.bz2
Merge remote branch 'origin/4.7' into oslo-staging-1
Conflicts: src/gui/itemviews/qabstractitemview.cpp
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/qglbuffer.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/opengl/qglbuffer.cpp b/src/opengl/qglbuffer.cpp
index 2ab7c32..755f34c 100644
--- a/src/opengl/qglbuffer.cpp
+++ b/src/opengl/qglbuffer.cpp
@@ -289,6 +289,10 @@ bool QGLBuffer::read(int offset, void *data, int count)
*/
void QGLBuffer::write(int offset, const void *data, int count)
{
+#ifndef QT_NO_DEBUG
+ if (!isCreated())
+ qWarning("QGLBuffer::allocate(): buffer not created");
+#endif
Q_D(QGLBuffer);
if (d->guard.id())
glBufferSubData(d->type, offset, count, data);
@@ -305,6 +309,10 @@ void QGLBuffer::write(int offset, const void *data, int count)
*/
void QGLBuffer::allocate(const void *data, int count)
{
+#ifndef QT_NO_DEBUG
+ if (!isCreated())
+ qWarning("QGLBuffer::allocate(): buffer not created");
+#endif
Q_D(QGLBuffer);
if (d->guard.id())
glBufferData(d->type, count, data, d->actualUsagePattern);
@@ -336,6 +344,10 @@ void QGLBuffer::allocate(const void *data, int count)
*/
bool QGLBuffer::bind() const
{
+#ifndef QT_NO_DEBUG
+ if (!isCreated())
+ qWarning("QGLBuffer::bind(): buffer not created");
+#endif
Q_D(const QGLBuffer);
GLuint bufferId = d->guard.id();
if (bufferId) {
@@ -364,6 +376,10 @@ bool QGLBuffer::bind() const
*/
void QGLBuffer::release() const
{
+#ifndef QT_NO_DEBUG
+ if (!isCreated())
+ qWarning("QGLBuffer::release(): buffer not created");
+#endif
Q_D(const QGLBuffer);
if (d->guard.id())
glBindBuffer(d->type, 0);
@@ -453,6 +469,10 @@ int QGLBuffer::size() const
void *QGLBuffer::map(QGLBuffer::Access access)
{
Q_D(QGLBuffer);
+#ifndef QT_NO_DEBUG
+ if (!isCreated())
+ qWarning("QGLBuffer::map(): buffer not created");
+#endif
if (!d->guard.id())
return 0;
if (!glMapBufferARB)
@@ -476,6 +496,10 @@ void *QGLBuffer::map(QGLBuffer::Access access)
bool QGLBuffer::unmap()
{
Q_D(QGLBuffer);
+#ifndef QT_NO_DEBUG
+ if (!isCreated())
+ qWarning("QGLBuffer::unmap(): buffer not created");
+#endif
if (!d->guard.id())
return false;
if (!glUnmapBufferARB)