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