From e35a83b293e6b38f6060895262b5494d36515e6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Mon, 29 Aug 2011 10:22:28 +0200 Subject: Clean up legacy defines in gui/opengl. Change-Id: I14d477c3f7a98cecca2c0a240ff13ea8ec64a154 Reviewed-on: http://codereview.qt.nokia.com/3716 Reviewed-by: Qt Sanity Bot Reviewed-by: Gunnar Sletta --- src/gui/opengl/qopenglbuffer.cpp | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'src/gui/opengl/qopenglbuffer.cpp') diff --git a/src/gui/opengl/qopenglbuffer.cpp b/src/gui/opengl/qopenglbuffer.cpp index 612938df16..4da0942e71 100644 --- a/src/gui/opengl/qopenglbuffer.cpp +++ b/src/gui/opengl/qopenglbuffer.cpp @@ -186,8 +186,6 @@ QOpenGLBuffer::QOpenGLBuffer(const QOpenGLBuffer &other) d_ptr->ref.ref(); } -#define ctx QOpenGLContext::currentContext(); - /*! Destroys this buffer object, including the storage being used in the GL server. @@ -250,8 +248,6 @@ void QOpenGLBuffer::setUsagePattern(QOpenGLBuffer::UsagePattern value) d->usagePattern = d->actualUsagePattern = value; } -#undef ctx - namespace { void freeBufferFunc(QOpenGLFunctions *funcs, GLuint id) { @@ -294,8 +290,6 @@ bool QOpenGLBuffer::create() return false; } -#define ctx QOpenGLContext::currentContext() - /*! Returns true if this buffer has been created; false otherwise. @@ -455,8 +449,6 @@ void QOpenGLBuffer::release() d->funcs->glBindBuffer(d->type, 0); } -#undef ctx - /*! Releases the buffer associated with \a type in the current QOpenGLContext. @@ -473,13 +465,10 @@ void QOpenGLBuffer::release() void QOpenGLBuffer::release(QOpenGLBuffer::Type type) { QOpenGLContext *ctx = QOpenGLContext::currentContext(); - if (ctx) { - QOpenGLFunctions(ctx).glBindBuffer(GLenum(type), 0); - } + if (ctx) + ctx->functions()->glBindBuffer(GLenum(type), 0); } -#define ctx QOpenGLContext::currentContext() - /*! Returns the GL identifier associated with this buffer; zero if the buffer has not been created. @@ -492,10 +481,6 @@ GLuint QOpenGLBuffer::bufferId() const return d->guard ? d->guard->id() : 0; } -#ifndef GL_BUFFER_SIZE -#define GL_BUFFER_SIZE 0x8764 -#endif - /*! Returns the size of the data in this buffer, for reading operations. Returns -1 if fetching the buffer size is not supported, or the -- cgit v1.2.3