Render quads as triangle fans

This commit is contained in:
BeaR 2014-10-15 15:44:29 +02:00
parent 5cb861c331
commit 944218ca9f
2 changed files with 1 additions and 9 deletions

View file

@ -322,12 +322,8 @@ void CCommandProcessorFragment_OpenGL::Cmd_Render(const CCommandBuffer::SCommand
switch(pCommand->m_PrimType) switch(pCommand->m_PrimType)
{ {
case CCommandBuffer::PRIMTYPE_QUADS: case CCommandBuffer::PRIMTYPE_QUADS:
#if defined(__ANDROID__)
for( unsigned i = 0, j = pCommand->m_PrimCount; i < j; i++ ) for( unsigned i = 0, j = pCommand->m_PrimCount; i < j; i++ )
glDrawArrays(GL_TRIANGLE_FAN, i*4, 4); glDrawArrays(GL_TRIANGLE_FAN, i*4, 4);
#else
glDrawArrays(GL_QUADS, 0, pCommand->m_PrimCount*4);
#endif
break; break;
case CCommandBuffer::PRIMTYPE_LINES: case CCommandBuffer::PRIMTYPE_LINES:
glDrawArrays(GL_LINES, 0, pCommand->m_PrimCount*2); glDrawArrays(GL_LINES, 0, pCommand->m_PrimCount*2);

View file

@ -92,12 +92,8 @@ void CGraphics_OpenGL::Flush()
if(m_RenderEnable) if(m_RenderEnable)
{ {
if(m_Drawing == DRAWING_QUADS) if(m_Drawing == DRAWING_QUADS)
#if defined(__ANDROID__)
for( unsigned i = 0, j = m_NumVertices; i < j; i += 4 ) for( unsigned i = 0, j = m_NumVertices; i < j; i += 4 )
glDrawArrays(GL_TRIANGLE_FAN, i, 4); glDrawArrays(GL_TRIANGLE_FAN, i, 4);
#else
glDrawArrays(GL_QUADS, 0, m_NumVertices);
#endif
else if(m_Drawing == DRAWING_LINES) else if(m_Drawing == DRAWING_LINES)
glDrawArrays(GL_LINES, 0, m_NumVertices); glDrawArrays(GL_LINES, 0, m_NumVertices);
} }