summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-03-23 02:16:30 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-03-23 02:16:30 (GMT)
commit3b8c2ac3de34dc43758dd36c0e57a83efda297a9 (patch)
tree7438d797025f4cf2bb7457a18556cf3d9d7fcf63 /src/opengl
parentf50f94512a22b311277ba07e09cf59e2c73bb25c (diff)
parent9973d39d7eb4461c79774aee420a4996051ffbfc (diff)
downloadQt-3b8c2ac3de34dc43758dd36c0e57a83efda297a9.zip
Qt-3b8c2ac3de34dc43758dd36c0e57a83efda297a9.tar.gz
Qt-3b8c2ac3de34dc43758dd36c0e57a83efda297a9.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: API fixes to QGLBuffer.
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/qglbuffer.cpp30
-rw-r--r--src/opengl/qglbuffer.h5
2 files changed, 14 insertions, 21 deletions
diff --git a/src/opengl/qglbuffer.cpp b/src/opengl/qglbuffer.cpp
index 755f34c..223243c 100644
--- a/src/opengl/qglbuffer.cpp
+++ b/src/opengl/qglbuffer.cpp
@@ -388,31 +388,23 @@ void QGLBuffer::release() const
#undef ctx
/*!
- Binds a raw \a bufferId to the specified buffer \a type
- in the current QGLContext. Returns false if there is
- no context current or the GL buffer extension could
- not be resolved.
+ Releases the buffer associated with \a type in the current
+ QGLContext.
- This function is a direct call to \c{glBindBuffer()} for
- use when the caller does not have a QGLBuffer but does
- have a raw \a bufferId. It can also be used to release
- the current buffer when the caller does not know which
- QGLBuffer object is currently bound:
+ This function is a direct call to \c{glBindBuffer(type, 0)}
+ for use when the caller does not know which QGLBuffer has
+ been bound to the context but wants to make sure that it
+ is released.
\code
- QGLBuffer::bind(QGLBuffer::VertexBuffer, 0);
+ QGLBuffer::release(QGLBuffer::VertexBuffer);
\endcode
*/
-bool QGLBuffer::bind(QGLBuffer::Type type, uint bufferId)
+void QGLBuffer::release(QGLBuffer::Type type)
{
const QGLContext *ctx = QGLContext::currentContext();
- if (ctx) {
- if (qt_resolve_buffer_extensions(const_cast<QGLContext *>(ctx))) {
- glBindBuffer(GLenum(type), GLuint(bufferId));
- return true;
- }
- }
- return false;
+ if (ctx && qt_resolve_buffer_extensions(const_cast<QGLContext *>(ctx)))
+ glBindBuffer(GLenum(type), 0);
}
#define ctx d->guard.context()
@@ -423,7 +415,7 @@ bool QGLBuffer::bind(QGLBuffer::Type type, uint bufferId)
\sa isCreated()
*/
-uint QGLBuffer::bufferId() const
+GLuint QGLBuffer::bufferId() const
{
Q_D(const QGLBuffer);
return d->guard.id();
diff --git a/src/opengl/qglbuffer.h b/src/opengl/qglbuffer.h
index a060733..2fe1f1f 100644
--- a/src/opengl/qglbuffer.h
+++ b/src/opengl/qglbuffer.h
@@ -43,6 +43,7 @@
#define QGLBUFFER_H
#include <QtCore/qscopedpointer.h>
+#include <QtOpenGL/qgl.h>
QT_BEGIN_HEADER
@@ -97,9 +98,9 @@ public:
bool bind() const;
void release() const;
- static bool bind(QGLBuffer::Type type, uint bufferId);
+ static void release(QGLBuffer::Type type);
- uint bufferId() const;
+ GLuint bufferId() const;
int size() const;