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

@ -230,7 +230,7 @@ void CCommandProcessorFragment_OpenGL::Cmd_Texture_Create(const CCommandBuffer::
// resample if needed
if(pCommand->m_Format == CCommandBuffer::TEXFORMAT_RGBA || pCommand->m_Format == CCommandBuffer::TEXFORMAT_RGB)
{
int MaxTexSize;
int MaxTexSize;
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &MaxTexSize);
if(Width > MaxTexSize || Height > MaxTexSize)
{
@ -322,12 +322,8 @@ void CCommandProcessorFragment_OpenGL::Cmd_Render(const CCommandBuffer::SCommand
switch(pCommand->m_PrimType)
{
case CCommandBuffer::PRIMTYPE_QUADS:
#if defined(__ANDROID__)
for( unsigned i = 0, j = pCommand->m_PrimCount; i < j; i++ )
glDrawArrays(GL_TRIANGLE_FAN, i*4, 4);
#else
glDrawArrays(GL_QUADS, 0, pCommand->m_PrimCount*4);
#endif
break;
case CCommandBuffer::PRIMTYPE_LINES:
glDrawArrays(GL_LINES, 0, pCommand->m_PrimCount*2);

View file

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