gsdx-ogl: extend device to support an offset for normal draw

This commit is contained in:
Gregory Hainaut 2015-08-01 13:33:30 +02:00
parent cabd7409e5
commit e972f4f4dd
3 changed files with 16 additions and 0 deletions

View File

@ -419,6 +419,13 @@ void GSDeviceOGL::DrawPrimitive()
AfterDraw();
}
void GSDeviceOGL::DrawPrimitive(int offset, int count)
{
BeforeDraw();
m_va->DrawPrimitive(offset, count);
AfterDraw();
}
void GSDeviceOGL::DrawIndexedPrimitive()
{
BeforeDraw();

View File

@ -598,6 +598,7 @@ class GSDeviceOGL : public GSDevice
void SetVSync(bool enable);
void DrawPrimitive();
void DrawPrimitive(int offset, int count);
void DrawIndexedPrimitive();
void DrawIndexedPrimitive(int offset, int count);
void BeforeDraw();

View File

@ -226,6 +226,12 @@ class GSBufferOGL {
glDrawArrays(mode, m_start, m_count);
}
void Draw(GLenum mode, int offset, int count)
{
glDrawArrays(mode, m_start + offset, count);
}
void Draw(GLenum mode, GLint basevertex)
{
gl_DrawElementsBaseVertex(mode, m_count, GL_UNSIGNED_INT, (void*)(m_start * m_stride), basevertex);
@ -302,6 +308,8 @@ public:
void DrawPrimitive() { m_vb->Draw(m_topology); }
void DrawPrimitive(int offset, int count) { m_vb->Draw(m_topology, offset, count); }
void DrawIndexedPrimitive() { m_ib->Draw(m_topology, m_vb->GetStart() ); }
void DrawIndexedPrimitive(int offset, int count) { m_ib->Draw(m_topology, m_vb->GetStart(), offset, count ); }