summaryrefslogtreecommitdiffstats
path: root/src/opengl/qwindowsurface_gl.cpp
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2009-12-03 10:53:31 (GMT)
committerSamuel Rødal <sroedal@trolltech.com>2009-12-04 18:07:56 (GMT)
commit60be72310c0f9469b3201b250b257473184ccf2a (patch)
treec8203883aecb1f700e97c978b3e47e3cf5209c87 /src/opengl/qwindowsurface_gl.cpp
parent1dc664cd24e3225fe2fcfd7552b3fa02fa4b8f9a (diff)
downloadQt-60be72310c0f9469b3201b250b257473184ccf2a.zip
Qt-60be72310c0f9469b3201b250b257473184ccf2a.tar.gz
Qt-60be72310c0f9469b3201b250b257473184ccf2a.tar.bz2
Fixed OpenGL graphicssystem issues for OpenGL ES 2.0 platforms.
The format and internal_format parameters to glTexImage2D need to always match on OpenGL ES 2.0. Reviewed-by: Tom Cooksey
Diffstat (limited to 'src/opengl/qwindowsurface_gl.cpp')
-rw-r--r--src/opengl/qwindowsurface_gl.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp
index e353f5d..7194f9d 100644
--- a/src/opengl/qwindowsurface_gl.cpp
+++ b/src/opengl/qwindowsurface_gl.cpp
@@ -493,7 +493,6 @@ void QGLWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoint &
}
#endif
d_ptr->paintedRegion = QRegion();
-
context()->swapBuffers();
} else {
glFlush();
@@ -688,11 +687,13 @@ void QGLWindowSurface::updateGeometry() {
d_ptr->size = rect.size();
if (d_ptr->ctx) {
+#ifndef QT_OPENGL_ES_2
if (d_ptr->destructive_swap_buffers) {
glBindTexture(target, d_ptr->tex_id);
glTexImage2D(target, 0, GL_RGBA, rect.width(), rect.height(), 0, GL_RGB, GL_UNSIGNED_BYTE, 0);
glBindTexture(target, 0);
}
+#endif
return;
}
@@ -756,11 +757,7 @@ void QGLWindowSurface::updateGeometry() {
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
-#ifndef QT_OPENGL_ES
glOrtho(0, d_ptr->pb->width(), d_ptr->pb->height(), 0, -999999, 999999);
-#else
- glOrthof(0, d_ptr->pb->width(), d_ptr->pb->height(), 0, -999999, 999999);
-#endif
d_ptr->pb->d_ptr->qctx->d_func()->internal_context = true;
return;
@@ -774,6 +771,7 @@ void QGLWindowSurface::updateGeometry() {
ctx->makeCurrent();
+#ifndef QT_OPENGL_ES_2
if (d_ptr->destructive_swap_buffers) {
glGenTextures(1, &d_ptr->tex_id);
glBindTexture(target, d_ptr->tex_id);
@@ -783,6 +781,7 @@ void QGLWindowSurface::updateGeometry() {
glTexParameterf(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glBindTexture(target, 0);
}
+#endif
qDebug() << "QGLWindowSurface: Using plain widget as window surface" << this;;
d_ptr->ctx = ctx;