mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Add (low level) functionality to allow rendering 3D Meshes.
- Add love.graphics.setDepthMode(testcomparison, enablewrites). - Add love.graphics.setMeshCullMode. - Add love.graphics.setFrontFaceWinding. Depth testing and depth writes require a depth buffer to work. The mesh cull mode controls whether front/back faces of a mesh are culled. The front face winding determines whether a clockwise or counterclockwise-oriented face in a mesh is considered front facing. --HG-- branch : minor
This commit is contained in:
@@ -266,15 +266,16 @@ void Text::draw(Graphics *gfx, const Matrix4 &m)
|
||||
|
||||
Graphics::TempTransform transform(gfx, m);
|
||||
|
||||
Graphics::DrawIndexedCommand drawcmd(&vertexAttributes, &vertexBuffers, quadIndices.getBuffer());
|
||||
drawcmd.indexType = quadIndices.getType();
|
||||
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);
|
||||
drawcmd.indexCount = (cmd.vertexcount / 4) * 6;
|
||||
drawcmd.indexBufferOffset = (cmd.startvertex / 4) * 6 * elemsize;
|
||||
drawcmd.texture = cmd.texture;
|
||||
gfx->draw(drawcmd);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user