mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 18:18:18 +00:00
Render quads as triangle fans
This commit is contained in:
parent
5cb861c331
commit
944218ca9f
|
@ -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);
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue