Fix QNetworkReply ioGetFromHttpWithCache test case
[profile/ivi/qtbase.git] / src / opengl / qglfunctions.h
index e789d40..da3ce7d 100644 (file)
@@ -1,8 +1,7 @@
 /****************************************************************************
 **
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
 **
 ** This file is part of the QtOpenGL module of the Qt Toolkit.
 **
@@ -35,6 +34,7 @@
 **
 **
 **
+**
 ** $QT_END_LICENSE$
 **
 ****************************************************************************/
 #endif
 
 #include <QtOpenGL/qgl.h>
+#include <QtGui/qopenglcontext.h>
 
 QT_BEGIN_HEADER
 
 QT_BEGIN_NAMESPACE
 
-QT_MODULE(OpenGL)
 
 // Types that aren't defined in all system's gl.h files.
 typedef ptrdiff_t qgl_GLintptr;
 typedef ptrdiff_t qgl_GLsizeiptr;
 
-#ifdef Q_WS_WIN
-#    define QGLF_APIENTRY APIENTRY
-#endif
 
-#ifndef Q_WS_MAC
 # ifndef QGLF_APIENTRYP
 #   ifdef QGLF_APIENTRY
 #     define QGLF_APIENTRYP QGLF_APIENTRY *
@@ -72,10 +68,6 @@ typedef ptrdiff_t qgl_GLsizeiptr;
 #     define QGLF_APIENTRYP *
 #   endif
 # endif
-#else
-# define QGLF_APIENTRY
-# define QGLF_APIENTRYP *
-#endif
 
 struct QGLFunctionsPrivate;
 
@@ -459,6 +451,8 @@ inline void QGLFunctions::glBindBuffer(GLenum target, GLuint buffer)
 
 inline void QGLFunctions::glBindFramebuffer(GLenum target, GLuint framebuffer)
 {
+    if (framebuffer == 0)
+        framebuffer = QOpenGLContext::currentContext()->defaultFramebufferObject();
 #if defined(QT_OPENGL_ES_2)
     ::glBindFramebuffer(target, framebuffer);
 #else