Abstracted lower level drawing code, moved all type-specific drawing code out of opengl backend, deleted obsolete files

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2017-10-26 20:58:19 -03:00
parent 7ffb04f019
commit e3fd489373
22 changed files with 109 additions and 630 deletions
+10 -1
View File
@@ -266,7 +266,16 @@ void Text::draw(Graphics *gfx, const Matrix4 &m)
Graphics::TempTransform transform(gfx, m);
drawInternal(draw_commands);
size_t elemsize = quadIndices.getElementSize();
IndexDataType datatype = quadIndices.getType();
Buffer *indexbuffer = quadIndices.getBuffer();
for (const Font::DrawCommand &cmd : draw_commands)
{
int count = (cmd.vertexcount / 4) * 6;
size_t offset = (cmd.startvertex / 4) * 6 * elemsize;
gfx->drawIndexed(PRIMITIVE_TRIANGLES, count, 1, datatype, indexbuffer, offset, vertexAttributes, vertexBuffers, cmd.texture);
}
}
} // graphics