Eduardo Bart 2012-12-08 16:14:10 -02:00
parent 7c48a98b67
commit ec8d50497b
4 changed files with 19 additions and 0 deletions

View File

@ -365,3 +365,16 @@ bool Graphics::canCacheBackbuffer()
return m_cacheBackbuffer; return m_cacheBackbuffer;
#endif #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
}

View File

@ -71,6 +71,7 @@ public:
bool canUseClampToEdge(); bool canUseClampToEdge();
bool canUseBlendFuncSeparate(); bool canUseBlendFuncSeparate();
bool canCacheBackbuffer(); bool canCacheBackbuffer();
bool hasScissorBug();
private: private:
Size m_viewportSize; Size m_viewportSize;

View File

@ -222,6 +222,7 @@ void Painter::updateGlClipRect()
glEnable(GL_SCISSOR_TEST); glEnable(GL_SCISSOR_TEST);
glScissor(m_clipRect.left(), m_resolution.height() - m_clipRect.bottom() - 1, m_clipRect.width(), m_clipRect.height()); glScissor(m_clipRect.left(), m_resolution.height() - m_clipRect.bottom() - 1, m_clipRect.width(), m_clipRect.height());
} else { } else {
glScissor(0, 0, m_resolution.width(), m_resolution.height());
glDisable(GL_SCISSOR_TEST); glDisable(GL_SCISSOR_TEST);
} }
} }

View File

@ -76,6 +76,10 @@ void PainterOGL1::drawCoords(CoordsBuffer& coordsBuffer, DrawMode drawMode)
updateGlTextureState(); updateGlTextureState();
} }
// GDI Generic driver has this bug
if(g_graphics.hasScissorBug())
updateGlClipRect();
// use vertex arrays if possible, much faster // use vertex arrays if possible, much faster
if(g_graphics.canUseDrawArrays()) { if(g_graphics.canUseDrawArrays()) {
// update coords buffer hardware caches if enabled // update coords buffer hardware caches if enabled