diff options
author | Tom Cooksey <thomas.cooksey@nokia.com> | 2009-05-05 18:49:53 (GMT) |
---|---|---|
committer | Tom Cooksey <thomas.cooksey@nokia.com> | 2009-05-05 18:49:53 (GMT) |
commit | 8baf1a4dfb2b1a1bb7ecb5ada93ed9972f0e7762 (patch) | |
tree | 6e76f13389be821def8399b52b0e0dc5b5e96bcf /src/opengl/qwindowsurface_gl.cpp | |
parent | 95088e80a523eaa1f4cfd276f56c1ccd64f387b5 (diff) | |
download | Qt-8baf1a4dfb2b1a1bb7ecb5ada93ed9972f0e7762.zip Qt-8baf1a4dfb2b1a1bb7ecb5ada93ed9972f0e7762.tar.gz Qt-8baf1a4dfb2b1a1bb7ecb5ada93ed9972f0e7762.tar.bz2 |
Fix OpenGL ES 2.0 breakages
Enable GL graphics system on ES 2.0 builds - it wont work, but now
QGLDrawable is being used it's just easier to build the graphics system.
Diffstat (limited to 'src/opengl/qwindowsurface_gl.cpp')
-rw-r--r-- | src/opengl/qwindowsurface_gl.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp index d92241d..4c2748c 100644 --- a/src/opengl/qwindowsurface_gl.cpp +++ b/src/opengl/qwindowsurface_gl.cpp @@ -382,6 +382,7 @@ void QGLWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoint & QRegion dirtyRegion = QRegion(window()->rect()) - d_ptr->paintedRegion; +#if !defined(QT_OPENGL_ES_2) if (!dirtyRegion.isEmpty()) { context()->makeCurrent(); @@ -407,6 +408,7 @@ void QGLWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoint & drawTexture(rect, d_ptr->tex_id, window()->size(), rect); } } +#endif d_ptr->paintedRegion = QRegion(); context()->swapBuffers(); @@ -455,7 +457,9 @@ void QGLWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoint & GL_NEAREST); glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, d_ptr->fbo->handle()); - } else { + } +#if !defined(QT_OPENGL_ES_2) + else { glDisable(GL_DEPTH_TEST); if (d_ptr->fbo) { @@ -485,6 +489,7 @@ void QGLWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoint & if (d_ptr->fbo) d_ptr->fbo->bind(); } +#endif if (ctx->format().doubleBuffer()) ctx->swapBuffers(); @@ -568,6 +573,7 @@ void QGLWindowSurface::updateGeometry() glTexParameterf(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glBindTexture(target, 0); +#if !defined(QT_OPENGL_ES_2) glMatrixMode(GL_PROJECTION); glLoadIdentity(); #ifndef QT_OPENGL_ES @@ -575,6 +581,7 @@ void QGLWindowSurface::updateGeometry() #else glOrthof(0, d_ptr->pb->width(), d_ptr->pb->height(), 0, -999999, 999999); #endif +#endif // !defined(QT_OPENGL_ES_2) d_ptr->pb->d_ptr->qctx->d_func()->internal_context = true; return; @@ -672,6 +679,7 @@ static void drawTexture(const QRectF &rect, GLuint tex_id, const QSize &texSize, extern void qt_add_rect_to_array(const QRectF &r, q_vertexType *array); // qpaintengine_opengl.cpp qt_add_rect_to_array(rect, vertexArray); +#if !defined(QT_OPENGL_ES_2) glVertexPointer(2, q_vertexTypeEnum, 0, vertexArray); glTexCoordPointer(2, q_vertexTypeEnum, 0, texCoordArray); @@ -683,6 +691,7 @@ static void drawTexture(const QRectF &rect, GLuint tex_id, const QSize &texSize, glDrawArrays(GL_TRIANGLE_FAN, 0, 4); glDisableClientState(GL_VERTEX_ARRAY); glDisableClientState(GL_TEXTURE_COORD_ARRAY); +#endif glDisable(target); glBindTexture(target, 0); |