glDrawElements fix

This commit is contained in:
Jack Andersen 2016-04-01 17:32:39 -10:00
parent d047a37e2b
commit 229b0b28a8
1 changed files with 5 additions and 3 deletions

View File

@ -228,7 +228,7 @@ public:
void bind(size_t idx, int b);
};
static std::vector<int32_t> DepthInitializer;
static std::vector<GLuint> DepthInitializer;
class GLTextureR : public ITextureR
{
@ -997,13 +997,15 @@ struct GLCommandQueue : IGraphicsCommandQueue
glDrawArrays(currentPrim, cmd.start, cmd.count);
break;
case Command::Op::DrawIndexed:
glDrawElements(currentPrim, cmd.count, GL_UNSIGNED_INT, (void*)cmd.start);
glDrawElements(currentPrim, cmd.count, GL_UNSIGNED_INT,
reinterpret_cast<void*>(cmd.start * 4));
break;
case Command::Op::DrawInstances:
glDrawArraysInstanced(currentPrim, cmd.start, cmd.count, cmd.instCount);
break;
case Command::Op::DrawInstancesIndexed:
glDrawElementsInstanced(currentPrim, cmd.count, GL_UNSIGNED_INT, (void*)cmd.start, cmd.instCount);
glDrawElementsInstanced(currentPrim, cmd.count, GL_UNSIGNED_INT,
reinterpret_cast<void*>(cmd.start * 4), cmd.instCount);
break;
case Command::Op::ResolveBindTexture:
{