diff --git a/src/framework/graphics/graphics.cpp b/src/framework/graphics/graphics.cpp index 7eb1c46b..d4aa2c1f 100644 --- a/src/framework/graphics/graphics.cpp +++ b/src/framework/graphics/graphics.cpp @@ -365,3 +365,16 @@ bool Graphics::canCacheBackbuffer() return m_cacheBackbuffer; #endif } + +bool Graphics::hasScissorBug() +{ +#if OPENGL_ES==2 + return false; +#elif OPENGL_ES==1 + return false; +#else + if(!GLEW_VERSION_1_2) + return true; + return false; +#endif +} diff --git a/src/framework/graphics/graphics.h b/src/framework/graphics/graphics.h index c817c659..f3f315a6 100644 --- a/src/framework/graphics/graphics.h +++ b/src/framework/graphics/graphics.h @@ -71,6 +71,7 @@ public: bool canUseClampToEdge(); bool canUseBlendFuncSeparate(); bool canCacheBackbuffer(); + bool hasScissorBug(); private: Size m_viewportSize; diff --git a/src/framework/graphics/painter.cpp b/src/framework/graphics/painter.cpp index 51daa50e..780abac7 100644 --- a/src/framework/graphics/painter.cpp +++ b/src/framework/graphics/painter.cpp @@ -222,6 +222,7 @@ void Painter::updateGlClipRect() glEnable(GL_SCISSOR_TEST); glScissor(m_clipRect.left(), m_resolution.height() - m_clipRect.bottom() - 1, m_clipRect.width(), m_clipRect.height()); } else { + glScissor(0, 0, m_resolution.width(), m_resolution.height()); glDisable(GL_SCISSOR_TEST); } } diff --git a/src/framework/graphics/painterogl1.cpp b/src/framework/graphics/painterogl1.cpp index f05acee0..429cd92f 100644 --- a/src/framework/graphics/painterogl1.cpp +++ b/src/framework/graphics/painterogl1.cpp @@ -76,6 +76,10 @@ void PainterOGL1::drawCoords(CoordsBuffer& coordsBuffer, DrawMode drawMode) updateGlTextureState(); } + // GDI Generic driver has this bug + if(g_graphics.hasScissorBug()) + updateGlClipRect(); + // use vertex arrays if possible, much faster if(g_graphics.canUseDrawArrays()) { // update coords buffer hardware caches if enabled