OpenGLRenderer: Implement primitive mode

This commit is contained in:
Jérôme Leclercq
2021-02-20 18:56:54 +01:00
parent ac3db8a8bf
commit 8f9f943e2c
3 changed files with 19 additions and 2 deletions

View File

@@ -81,12 +81,12 @@ namespace Nz
else if constexpr (std::is_same_v<T, DrawData>)
{
ApplyStates(*context, command.states);
context->glDrawArraysInstanced(GL_TRIANGLES, command.firstVertex, command.vertexCount, command.instanceCount);
context->glDrawArraysInstanced(ToOpenGL(command.states.pipeline->GetPipelineInfo().primitiveMode), command.firstVertex, command.vertexCount, command.instanceCount);
}
else if constexpr (std::is_same_v<T, DrawIndexedData>)
{
ApplyStates(*context, command.states);
context->glDrawElementsInstanced(GL_TRIANGLES, command.indexCount, GL_UNSIGNED_SHORT, nullptr, command.instanceCount);
context->glDrawElementsInstanced(ToOpenGL(command.states.pipeline->GetPipelineInfo().primitiveMode), command.indexCount, GL_UNSIGNED_SHORT, nullptr, command.instanceCount);
}
else if constexpr (std::is_same_v<T, SetFrameBufferData>)
{